Skip to main content

elapsed time

Project description

Install

$ [sudo] pip install elapsed

Features

  • datetime elapsed time
  • process elapsed time by pid

Examples

datetime elapsed time

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

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

>>> import elapsed
>>> e = elapsed.time(pid=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(pid=1)
232238
>>> elapsed.minutes(pid=1)
3870
>>> elapsed.hours(pid=1)
64
>>> elapsed.days(pid=1)
2

Project details


Download files

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

Source Distribution

elapsed-0.0.2.tar.gz (1.8 kB view hashes)

Uploaded Source

Built Distribution

elapsed-0.0.2-py2.py3-none-any.whl (2.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page