aboutsummaryrefslogtreecommitdiff
path: root/internal/timer/timer.go
blob: 8122136c097ff1d115859fe1fa289ffa848d911b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package timer // import "miniflux.app/v2/internal/timer"

import (
	"time"

	"miniflux.app/v2/internal/logger"
)

// ExecutionTime returns the elapsed time of a block of code.
func ExecutionTime(start time.Time, name string) {
	elapsed := time.Since(start)
	logger.Debug("%s took %s", name, elapsed)
}