From 868d229f1324014f704a70c51db391f5a0abe469 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 14 Oct 2017 16:43:56 +0200 Subject: [PATCH] Set precision to ms (not seconds) but rounded not floored --- feature/motheure-simple/source/loop.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/feature/motheure-simple/source/loop.php b/feature/motheure-simple/source/loop.php index 1b57bd8..baab23d 100644 --- a/feature/motheure-simple/source/loop.php +++ b/feature/motheure-simple/source/loop.php @@ -103,7 +103,9 @@ /* [2] Main loop =========================================================*/ /* (1) Log action to default log file */ - $f_data->fwrite( "[" . floor( $stop_ts - $start_ts ) ."]\n" ); + $elapsed = $stop_ts - $start_ts; + $elapsed = round($elapsed*1000) / 1000; + $f_data->fwrite( "[" . $elapsed ."]\n" ); slog("Motor stop", 'motheure-simple:loop', 'motheure'); /* (2) Return status */