Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

elapsed time

Project description

Installation

$ [sudo] pip install elapsed

Features

  • accepts datetime or pid. os.getcwd() by default

Classes

class __doc__
elapsed.Elapsed

Functions

function __doc__
elapsed.days(input=None) return elapsed time in days. accepts pid or datetime
elapsed.get(input=None) return elapsed.Elapsed instance. accepts pid or datetime
elapsed.hours(input=None) return elapsed time in hours. accepts pid or datetime
elapsed.minutes(input=None) return elapsed time in minutes. accepts pid or datetime
elapsed.seconds(input=None) return elapsed time in seconds. accepts pid or datetime

Examples

datetime elapsed time

>>> dt = datetime.datetime.now()
>>> time.sleep(2)
>>> elapsed.get(dt)
'00:02'

process elapsed time by pid (os.getpid() by default)

>>> import elapsed
>>> e = elapsed.get(1)
'02-16:30:38'
>>> e.days, e.hours, e.minutes, e.seconds
(2, 64, 3870, 232238)

elapsed.seconds(), elapsed.minutes(), elapsed.hours(), elapsed.days()

>>> elapsed.seconds(1)
232238
>>> elapsed.minutes(1)
3870
>>> elapsed.hours(1)
64
>>> elapsed.days(1)
2

python-readme-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for elapsed, version 2019.4.13
Filename, size File type Python version Upload date Hashes
Filename, size elapsed-2019.4.13.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page