Changeset 373 in tmcsimulator for trunk/webapps/runTimer.py


Ignore:
Timestamp:
04/16/2019 10:11:47 AM (7 years ago)
Author:
jdalbey
Message:

Update filenames in code to match dir reorg

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/webapps/runTimer.py

    r348 r373  
    11#!/usr/bin/python 
    22# Run a timer and save it to a file 
     3# This allows for isolation testing of einotebook without 
     4# Sim Mgr having to run. 
    35import time 
    46from datetime import timedelta 
     7print "Starting elapsed timer ..." 
    58count = 0 
    69while True: 
     
    811    time.sleep(1) 
    912    count += 1 
    10     elapsedTime = timedelta(seconds=count) 
     13    # elapsedTime = timedelta(seconds=count) 
    1114    # convert integer into hh:mm:ss format 
    12     lineout =  "{\"clock\":\"" + str(elapsedTime) + "\"}" 
     15    lineout =  "{\"elapsedtime\":\"" + str(count) + "\"}" 
    1316     
    1417    # write message to file 
    15     text_file = open("sim_clock.json", "w") 
     18    text_file = open("dynamicdata/sim_elapsedtime.json", "w") 
    1619    text_file.write(lineout) 
    1720    text_file.close() 
    1821 
    19     print count 
     22    # print count 
    2023 
    2124 
Note: See TracChangeset for help on using the changeset viewer.