You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
314 B
JavaScript
15 lines
314 B
JavaScript
7 years ago
|
var timers = require('timers');
|
||
|
|
||
|
var obj = {
|
||
|
_onTimeout: function() {
|
||
|
console.log('Timer ran for: ' + (new Date().getTime() - obj.now) + ' ms');
|
||
|
},
|
||
|
start: function() {
|
||
|
console.log('Timer should run for 100 ms');
|
||
|
this.now = new Date().getTime();
|
||
|
timers.enroll(this, 100);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
obj.start();
|