From 3312bf5df24c7fc72a32139f179f58b61d884a8c Mon Sep 17 00:00:00 2001 From: cTn Date: Wed, 1 Oct 2014 15:18:37 +0200 Subject: [PATCH] fix timers --- js/protocols/stm32.js | 4 ++-- js/protocols/stm32usbdfu.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/protocols/stm32.js b/js/protocols/stm32.js index e589fda0d3..a769816bef 100644 --- a/js/protocols/stm32.js +++ b/js/protocols/stm32.js @@ -128,7 +128,7 @@ STM32_protocol.prototype.initialize = function () { self.receive_buffer = []; self.verify_hex = []; - self.upload_time_start = microtime(); + self.upload_time_start = millitime(); self.upload_process_alive = false; // reset progress bar to initial state @@ -655,7 +655,7 @@ STM32_protocol.prototype.upload_procedure = function (step) { // disconnect GUI.interval_remove('STM32_timeout'); // stop STM32 timeout timer (everything is finished now) - console.log('Script finished after: ' + (microtime() - self.upload_time_start).toFixed(4) + ' seconds'); + console.log('Script finished after: ' + ((millitime() - self.upload_time_start) / 1000) + ' seconds'); // close connection serial.disconnect(function (result) { diff --git a/js/protocols/stm32usbdfu.js b/js/protocols/stm32usbdfu.js index e145f97743..7b614168e7 100644 --- a/js/protocols/stm32usbdfu.js +++ b/js/protocols/stm32usbdfu.js @@ -67,7 +67,7 @@ STM32DFU_protocol.prototype.connect = function (device, hex) { self.hex = hex; // reset and set some variables before we start - self.upload_time_start = microtime(); + self.upload_time_start = millitime(); self.verify_hex = []; // reset progress bar to initial state @@ -466,7 +466,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) { break; case 99: // cleanup - console.log('Script finished after: ' + (microtime() - self.upload_time_start).toFixed(4) + ' seconds'); + console.log('Script finished after: ' + ((millitime() - self.upload_time_start) / 1000) + ' seconds'); self.releaseInterface(0); break;