This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Simple python module for mark time.

Inspired by two functions from node.js:

Main features:

  • easy to use
  • no external dependencies
  • 100% test coverage
  • works with Python 2.7 and 3.3

Usage

$ pip install marktime
import marktime

marktime.start('some task')
marktime.start('some another task')

marktime.stop('some task')
8.757422924041748

marktime.stop('some another task').seconds
14.805735111236572

marktime.duration('some another task').msecs
14805.735111236572

marktime.start('some task # 3')

with marktime.stopwatch('some task # 4'):
    marktime.time.sleep(1)

import json
print json.dumps(marktime.labels, indent=4)
{
    "some another task": {
        "duration": 14.805735111236572,
        "start_time": 1370453758.064955,
        "end_time": 1370453772.87069
    },
    "some task # 3": {
        "start_time": 1370453892.025603,
        "end_time": None
    },
    "some task # 4": {
        "duration": 1.00120210647583,
        "start_time": 1370638027.000799,
        "end_time": 1370638028.002001
    },
    "some task": {
        "duration": 8.757422924041748,
        "start_time": 1370453753.185846,
        "end_time": 1370453761.943269
    }
}

API

  • marktime.start (label, at=None)
    • label — marker label. String. Required.
    • at — time to start the countdown. If None then uses time.time().
  • marktime.stop (label, remove_from_labels=False, stop_once=True)
    • label — marker label. String. Required.
    • at — time to stop the countdown. If None then uses time.time()
    • remove_from_labels — if True then label removed from global dict marktime.labels.
    • stop_once — if False and the countdown for the certain label is allready stopped thet it stopped it again. And thereafter the duration for the certain label will be increased.
  • marktime.duration (label, stop_it=True, stop_at=None)
    • label — marker label. String. Required.
    • stop_it — if True then the countdown for the certain label will be stopped. If False and the countdown for the certain label is not stopped then returns None.
    • stop_at — passed into stop function if stop_it == True
  • marktime.stopwatch (label) — context manager (with statement support)
  • marktime.labels — global dict that stores all the labels for time markers.

License

See LICENSE file.

Release History

Release History

0.2.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
marktime-0.2.0.tar.gz (3.2 kB) Copy SHA256 Checksum SHA256 Source Jun 7, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting