File tree 1 file changed +2
-11
lines changed
1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -11,28 +11,20 @@ const {
11
11
const { setUnrefTimeout } = require ( 'internal/timers' ) ;
12
12
const { PerformanceEntry, notify } = internalBinding ( 'performance' ) ;
13
13
14
- let nowCache ;
15
14
let utcCache ;
16
15
17
- function nowDate ( ) {
18
- if ( ! nowCache ) cache ( ) ;
19
- return nowCache ;
20
- }
21
-
22
16
function utcDate ( ) {
23
17
if ( ! utcCache ) cache ( ) ;
24
18
return utcCache ;
25
19
}
26
20
27
21
function cache ( ) {
28
22
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 ( ) ) ;
32
25
}
33
26
34
27
function resetCache ( ) {
35
- nowCache = undefined ;
36
28
utcCache = undefined ;
37
29
}
38
30
@@ -55,7 +47,6 @@ function emitStatistics(statistics) {
55
47
module . exports = {
56
48
kOutHeaders : Symbol ( 'kOutHeaders' ) ,
57
49
kNeedDrain : Symbol ( 'kNeedDrain' ) ,
58
- nowDate,
59
50
utcDate,
60
51
emitStatistics
61
52
} ;
You can’t perform that action at this time.
0 commit comments