2023-06-19 23:42:47 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2017-11-20 06:10:04 +01:00
|
|
|
|
2018-08-25 06:51:50 +02:00
|
|
|
package timer // import "miniflux.app/timer"
|
2017-11-20 06:10:04 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2017-12-16 03:55:57 +01:00
|
|
|
|
2018-08-25 06:51:50 +02:00
|
|
|
"miniflux.app/logger"
|
2017-11-20 06:10:04 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// ExecutionTime returns the elapsed time of a block of code.
|
|
|
|
func ExecutionTime(start time.Time, name string) {
|
|
|
|
elapsed := time.Since(start)
|
2017-12-16 03:55:57 +01:00
|
|
|
logger.Debug("%s took %s", name, elapsed)
|
2017-11-20 06:10:04 +01:00
|
|
|
}
|