2023-06-19 14:42:47 -07:00
|
|
|
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2017-11-19 21:10:04 -08:00
|
|
|
|
2023-08-10 19:46:45 -07:00
|
|
|
package timer // import "miniflux.app/v2/internal/timer"
|
2017-11-19 21:10:04 -08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2017-12-15 18:55:57 -08:00
|
|
|
|
2023-08-10 19:46:45 -07:00
|
|
|
"miniflux.app/v2/internal/logger"
|
2017-11-19 21:10:04 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
// ExecutionTime returns the elapsed time of a block of code.
|
|
|
|
func ExecutionTime(start time.Time, name string) {
|
|
|
|
elapsed := time.Since(start)
|
2017-12-15 18:55:57 -08:00
|
|
|
logger.Debug("%s took %s", name, elapsed)
|
2017-11-19 21:10:04 -08:00
|
|
|
}
|