mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 18:02:21 +00:00

Record the start time so we can make the return value of Timer.now() relative to it, increasing the chances that it fits in a tagged integer instead of a heap-allocated double, at least for the first one or two billion milliseconds. PR-URL: https://github.com/nodejs/io.js/pull/2256 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
9 lines
251 B
JavaScript
9 lines
251 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
// Return value of Timer.now() should easily fit in a SMI right after start-up.
|
|
const Timer = process.binding('timer_wrap').Timer;
|
|
assert(Timer.now() < 0x3ffffff);
|