GithubHelp home page GithubHelp logo

sonic2kdbs / desk-timer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 119 KB

A timer for the desktop.

License: GNU General Public License v2.0

Python 100.00%
cooking countdown countdown-timer desktop eieruhr timer desk-timer desktimer s2k sonic2k

desk-timer's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m Sonic2k, @Sonic2kDBS
  • ๐Ÿ‘€ Iโ€™m interested in Bash, Python, AI and Coffee
  • ๐ŸŒฑ Iโ€™m currently learning Python
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on interesting ideas
  • ๐Ÿ“ซ How to reach me: e-mail [email protected]
  • ๐ŸฆŠ Also, I am Furry and Computer expert

desk-timer's People

Contributors

sonic2kdbs avatar

Watchers

 avatar

desk-timer's Issues

Using time.sleep(1) is not accurate

As all modern OS implement some kind of multi tasking, when you call sleep, your process will be set to sleeping state until the sleep time has elapsed. But it will not reactivate your process exactly after 1 second, instead it will be 1 second + some more or less random x.
So this timer is not accurate especially for long durations.
The better way to implement this would be to save your current system time when you click start (e.g. with starttime = datetime.datetime.now()). Then while running, substract current time from starttime:

import datetime
starttime = datetime.datetime.now()

# later
delta = datetime.datetime.now() - starttime

delta will be a datetime.timedelta object with minutes/seconds/milliseconds that elapsed since starttime.

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.