Giter Club home page Giter Club logo

pytimer's Introduction

PyTimer

PyTimer is a simple timeout module. Given a start time and duration it can be querried whenever needed to determine if the elapsed time has passed. It can also easily be called multiple times to run multiple timers.

Installation

Install PyTimer.py into your site-packages directory.

Starting a Timer

The initial call should include the first letter of the desired unit of time. Possible units are seconds, minutes, or hours:

>>> clock = Timer(unit)

To start the timer give a duration:

>>> clock.start(duration)

Check the timeout status

Check the status of the timer. It returns either True or False. If True the timer has finished:

>>> clock.accepted

Updates clock.accepted, done once when clock.start is called. This must be called every time the status needs to be checked:

>>> clock.test()

pytimer's People

Contributors

emorydunn avatar

Watchers

 avatar  avatar

pytimer's Issues

Simplify Timer.start

It can be assumed that when the timer is started it's being done with the current time and this should be done by PyTime, not the script using it.

Parse Full Units

Allow words to be passed to the timer instead of just the first letter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.