mirror of
https://github.com/nodejs/node.git
synced 2024-11-25 08:19:38 +01:00
13 lines
340 B
JavaScript
13 lines
340 B
JavaScript
|
var common = require('../common');
|
||
|
var assert = require('assert');
|
||
|
|
||
|
var TIMEOUT = 50;
|
||
|
var last = process.hrtime();
|
||
|
setTimeout(function() {
|
||
|
var hr = process.hrtime(last);
|
||
|
var ms = (hr[0] * 1e3) + (hr[1] / 1e6);
|
||
|
var delta = ms - TIMEOUT;
|
||
|
console.log('timer fired in', delta);
|
||
|
assert.ok(delta > 0, 'Timer fired early');
|
||
|
}, TIMEOUT);
|