From: theStack Date: Tue, 15 Dec 2009 20:41:50 +0000 (+0100) Subject: add time measurement for performance comparisons X-Git-Tag: v0.1~5 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=pyfrprog.git;a=commitdiff_plain;h=aa7ae00606beffecc4e058868a81c76a6872110d add time measurement for performance comparisons --- diff --git a/frprog.py b/frprog.py index 76431c1..b9432a8 100755 --- a/frprog.py +++ b/frprog.py @@ -210,6 +210,8 @@ while True: # timeout happened, who cares ;-) pass +starttime = time.time() # save time at this point for evaluating the duration at the end + print "OK, trying to set baudrate..." # set baudrate bootromBAUDRATE(BOOTLOADER_BAUDRATE) @@ -239,7 +241,6 @@ tty = SerialPort(DEVICE, None, KERNEL_BAUDRATE) print "Performing ChipErase..." pkernCHIPERASE() -print "Chip erasing done." print "Flashing", for seq in pkernelseqs: @@ -253,7 +254,9 @@ for seq in pkernelseqs: sys.stdout.write(".") sys.stdout.flush() print -print "Flashing done." + +duration = time.time() - starttime +print "Procedure complete, took", round(duration, 2), "seconds." sendByte(0x97) # exit and restart print "Program was started. Have fun!"