Time Tracking

python working time toggl tracking

http://www.online-stopwatch.com/cash-clock/

import sys
import datetime
import keyboard 
import time

timeInSeconds = 0
tillNowTime = 0
startedTime = str(datetime.datetime.now())
rate = 1.2
eq = 0

while True:
	if keyboard.is_pressed("esc"):
		break

	tillNowTime = str(datetime.timedelta(seconds = timeInSeconds))
	eq += rate
	sys.stdout.write("Started at: %s  |  Till now: %s , %s[X]\r" %( startedTime, tillNowTime, str(eq)) )
	sys.stdout.flush()
	timeInSeconds += 1
	
	time.sleep(1)	
	
print("\n--------\nEnded at: " + str(datetime.datetime.now()) + " | Total: " + str(tillNowTime) )

Comments

  1. I was just searching for this info for some time. After 6 hours of continuous Googleing, finally I got it in your web site. I wonder what’s the lack of Google strategy that do not rank this kind of informative sites in top of the list. Generally the top web sites are full of garbage.

Leave a Reply

Your email address will not be published. Required fields are marked *