Stopwatch = function () {
};
// You can get the elapsed time while the timer is running, or after it's
// stopped.
Stopwatch.prototype = {
startTime: 0,
running: false,
elapsed: undefined,
start: function () {
this.startTime = +new Date();
this.elapsedTime = undefined;
this.running = true;
},
stop: function () {
this.elapsed = (+new Date()) - this.startTime;
this.running = false;
},
getElapsedTime: function () {
if (this.running) {
return (+new Date()) - this.startTime;
}
else {
return this.elapsed;
}
},
isRunning: function() {
return this.running;
},
reset: function() {
this.elapsed = 0;
}
};
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
我的flag 2022年终总结平淡无奇,2022年终总结中立的flag: 完成15篇文章 搞钱 完成情况: 完成九篇原创技术类文章,一篇读书总结 学会Pointer指针事件 ,一套拖拽事件两端(PC端、移动端)跑 mitt用100行实现发布-订阅模式还收获了9…