diff --git a/lib/internal/http.js b/lib/internal/http.js index 0065f93fd896f0..b17687d4d81624 100644 --- a/lib/internal/http.js +++ b/lib/internal/http.js @@ -5,20 +5,13 @@ const { Date, DatePrototypeGetMilliseconds, DatePrototypeToUTCString, - DatePrototypeValueOf, } = primordials; const { setUnrefTimeout } = require('internal/timers'); const { PerformanceEntry, notify } = internalBinding('performance'); -let nowCache; let utcCache; -function nowDate() { - if (!nowCache) cache(); - return nowCache; -} - function utcDate() { if (!utcCache) cache(); return utcCache; @@ -26,13 +19,11 @@ function utcDate() { function cache() { const d = new Date(); - nowCache = DatePrototypeValueOf(d); utcCache = DatePrototypeToUTCString(d); setUnrefTimeout(resetCache, 1000 - DatePrototypeGetMilliseconds(d)); } function resetCache() { - nowCache = undefined; utcCache = undefined; } @@ -55,7 +46,6 @@ function emitStatistics(statistics) { module.exports = { kOutHeaders: Symbol('kOutHeaders'), kNeedDrain: Symbol('kNeedDrain'), - nowDate, utcDate, emitStatistics };