diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-05-09 10:05:19 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-05-09 14:18:40 +0200 |
commit | 51f08b0b6aae175299b4e73d521343a4386a9cf7 (patch) | |
tree | 6966bc277671a1f62e9363a2a16fa7a2d6ccacd1 /common | |
parent | 860c51c314e1f2b06b1424a3b277a2db96fc1f04 (diff) |
Revise the use of htime.Since/htime.Now
We cannot (also, it doesn't add any value) use that when the `clock` is set,
* To measure time (before that global is set)
* To compare file timestamps re cache eviction
Fixes #9868
Diffstat (limited to 'common')
-rw-r--r-- | common/loggers/loggers.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/common/loggers/loggers.go b/common/loggers/loggers.go index 6b73c9f32..14c76ae45 100644 --- a/common/loggers/loggers.go +++ b/common/loggers/loggers.go @@ -24,7 +24,6 @@ import ( "runtime" "time" - "github.com/gohugoio/hugo/common/htime" "github.com/gohugoio/hugo/common/terminal" jww "github.com/spf13/jwalterweatherman" @@ -177,7 +176,7 @@ func (l *logger) Out() io.Writer { // PrintTimerIfDelayed prints a time statement to the FEEDBACK logger // if considerable time is spent. func (l *logger) PrintTimerIfDelayed(start time.Time, name string) { - elapsed := htime.Since(start) + elapsed := time.Since(start) milli := int(1000 * elapsed.Seconds()) if milli < 500 { return @@ -186,7 +185,7 @@ func (l *logger) PrintTimerIfDelayed(start time.Time, name string) { } func (l *logger) PrintTimer(start time.Time, name string) { - elapsed := htime.Since(start) + elapsed := time.Since(start) milli := int(1000 * elapsed.Seconds()) l.Printf("%s in %v ms", name, milli) } |