File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,9 @@ namespace mlrunner {
7373
7474 void runModel () {
7575 if (!initialised) return ;
76- unsigned int time_start = uBit.systemTime ();
76+ #if ML_DEBUG_PRINT
77+ const unsigned int time_start = system_timer_current_time_us ();
78+ #endif
7779
7880 float *modelData = mlDataProcessor.getProcessedData ();
7981 if (modelData == NULL ) {
@@ -88,7 +90,8 @@ namespace mlrunner {
8890 uBit.panic (MlRunnerError::ErrorModelInference);
8991 }
9092
91- DEBUG_PRINT (" P (%d ms): " , uBit.systemTime () - time_start);
93+ #if ML_DEBUG_PRINT
94+ DEBUG_PRINT (" P (%d us): " , system_timer_current_time_us () - time_start);
9295 if (predictions->index >= 0 ) {
9396 DEBUG_PRINT_RAW (" %d %s\t\t " ,
9497 predictions->index ,
@@ -101,7 +104,8 @@ namespace mlrunner {
101104 actions->action [i].label ,
102105 (int )(predictions->prediction [i] * 100 ));
103106 }
104- DEBUG_PRINT_RAW (" \n\n " );
107+ DEBUG_PRINT_RAW (" \n " );
108+ #endif
105109
106110 // Model prediction events start after the None event ID
107111 uint16_t predictionEventId = predictions->index + ML_EVENT_NONE_ID + 1 ;
You can’t perform that action at this time.
0 commit comments