How to use the humanize.time.naturaldelta function in humanize

To help you get started, we’ve selected a few humanize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ga4gh / ga4gh-server / scripts / utils.py View on Github external
def _report(self):
        delta = self.end - self.start
        timeString = humanize.time.naturaldelta(delta)
        log("Finished in {} ({:.2f} seconds)".format(timeString, delta))
github 1flow / sparks / sparks / utils / __init__.py View on Github external
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