Changeset 373 in tmcsimulator for trunk/webapps/runTimer.py
- Timestamp:
- 04/16/2019 10:11:47 AM (7 years ago)
- File:
-
- 1 moved
-
trunk/webapps/runTimer.py (moved) (moved from trunk/webapps/cptms/runTimer.py) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/runTimer.py
r348 r373 1 1 #!/usr/bin/python 2 2 # Run a timer and save it to a file 3 # This allows for isolation testing of einotebook without 4 # Sim Mgr having to run. 3 5 import time 4 6 from datetime import timedelta 7 print "Starting elapsed timer ..." 5 8 count = 0 6 9 while True: … … 8 11 time.sleep(1) 9 12 count += 1 10 elapsedTime = timedelta(seconds=count)13 # elapsedTime = timedelta(seconds=count) 11 14 # convert integer into hh:mm:ss format 12 lineout = "{\" clock\":\"" + str(elapsedTime) + "\"}"15 lineout = "{\"elapsedtime\":\"" + str(count) + "\"}" 13 16 14 17 # write message to file 15 text_file = open(" sim_clock.json", "w")18 text_file = open("dynamicdata/sim_elapsedtime.json", "w") 16 19 text_file.write(lineout) 17 20 text_file.close() 18 21 19 print count22 # print count 20 23 21 24
Note: See TracChangeset
for help on using the changeset viewer.
