File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -11,28 +11,20 @@ const {
1111const { setUnrefTimeout } = require ( 'internal/timers' ) ;
1212const { PerformanceEntry, notify } = internalBinding ( 'performance' ) ;
1313
14- let nowCache ;
1514let utcCache ;
1615
17- function nowDate ( ) {
18- if ( ! nowCache ) cache ( ) ;
19- return nowCache ;
20- }
21-
2216function utcDate ( ) {
2317 if ( ! utcCache ) cache ( ) ;
2418 return utcCache ;
2519}
2620
2721function cache ( ) {
2822 const d = new Date ( ) ;
29- nowCache = DatePrototypeValueOf ( d ) ;
30- utcCache = DatePrototypeToUTCString ( d ) ;
31- setUnrefTimeout ( resetCache , 1000 - DatePrototypeGetMilliseconds ( d ) ) ;
23+ utcCache = d . toUTCString ( ) ;
24+ setUnrefTimeout ( resetCache , 1000 - d . getMilliseconds ( ) ) ;
3225}
3326
3427function resetCache ( ) {
35- nowCache = undefined ;
3628 utcCache = undefined ;
3729}
3830
@@ -55,7 +47,6 @@ function emitStatistics(statistics) {
5547module . exports = {
5648 kOutHeaders : Symbol ( 'kOutHeaders' ) ,
5749 kNeedDrain : Symbol ( 'kNeedDrain' ) ,
58- nowDate,
5950 utcDate,
6051 emitStatistics
6152} ;
You can’t perform that action at this time.
0 commit comments