2015-05-19 19:00:06 +08:00
|
|
|
'use strict';
|
2015-12-24 08:02:12 +08:00
|
|
|
require('../common');
|
2011-03-15 08:48:05 +08:00
|
|
|
var assert = require('assert');
|
|
|
|
|
|
|
|
console.error(process.uptime());
|
2011-07-06 02:26:21 +08:00
|
|
|
assert.ok(process.uptime() <= 2);
|
|
|
|
|
|
|
|
var original = process.uptime();
|
2011-03-15 08:48:05 +08:00
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
var uptime = process.uptime();
|
|
|
|
// some wiggle room to account for timer
|
|
|
|
// granularity, processor speed, and scheduling
|
2011-07-06 02:26:21 +08:00
|
|
|
assert.ok(uptime >= original + 2);
|
|
|
|
assert.ok(uptime <= original + 3);
|
2011-03-15 08:48:05 +08:00
|
|
|
}, 2000);
|