2018-01-02 19:15:08 -08:00
|
|
|
// Copyright 2018 Frédéric Guillot. All rights reserved.
|
2017-11-19 21:10:04 -08:00
|
|
|
// Use of this source code is governed by the Apache 2.0
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2018-08-24 21:51:50 -07:00
|
|
|
package timer // import "miniflux.app/timer"
|
2017-11-19 21:10:04 -08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2017-12-15 18:55:57 -08:00
|
|
|
|
2018-08-24 21:51:50 -07:00
|
|
|
"miniflux.app/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
|
|
|
}
|