timer.go 398 B

12345678910111213141516
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package timer // import "miniflux.app/timer"
  4. import (
  5. "time"
  6. "miniflux.app/logger"
  7. )
  8. // ExecutionTime returns the elapsed time of a block of code.
  9. func ExecutionTime(start time.Time, name string) {
  10. elapsed := time.Since(start)
  11. logger.Debug("%s took %s", name, elapsed)
  12. }