#!/usr/bin/python # Run a timer and save it to a file # This allows for isolation testing of einotebook without # Sim Mgr having to run. import time from datetime import timedelta print "Starting elapsed timer ..." count = 0 while True: # Code executed here time.sleep(1) count += 1 # elapsedTime = timedelta(seconds=count) # convert integer into hh:mm:ss format lineout = "{\"elapsedtime\":\"" + str(count) + "\"}" # write message to file text_file = open("dynamicdata/sim_elapsedtime.json", "w") text_file.write(lineout) text_file.close() # print count