timer.go 445 B

1234567891011121314151617
  1. // Copyright 2018 Frédéric Guillot. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package timer // import "miniflux.app/timer"
  5. import (
  6. "time"
  7. "miniflux.app/logger"
  8. )
  9. // ExecutionTime returns the elapsed time of a block of code.
  10. func ExecutionTime(start time.Time, name string) {
  11. elapsed := time.Since(start)
  12. logger.Debug("%s took %s", name, elapsed)
  13. }