Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _report(self):
delta = self.end - self.start
timeString = humanize.time.naturaldelta(delta)
log("Finished in {} ({:.2f} seconds)".format(timeString, delta))
def __exit__(self, ty, val, tb):
""" Stop the timer and display a logging message with elapsed time. """
LOGGER.info("%s started %s, ran in %s.", self.name, self.dtstart,
naturaldelta(time.time() - self.start))
return False