Skip to content

Commit 63a665f

Browse files
committed
Add function timing helper function
1 parent b1b598e commit 63a665f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ bool newAPSettings = false; //Goes true when new setting is received via AP conf
399399

400400
unsigned int binBytesSent = 0; //Tracks firmware bytes sent over WiFi OTA update via AP config.
401401
int binBytesLastUpdate = 0; //Allows websocket notification to be sent every 100k bytes
402+
403+
unsigned long startTime = 0; //Used for checking longest running functions
402404
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
403405

404406
void setup()
@@ -635,4 +637,6 @@ void updateRTC()
635637
}
636638

637639
void printElapsedTime(const char* title)
640+
{
641+
Serial.printf("%s: %d\n\r", title, millis() - startTime);
638642
}

0 commit comments

Comments
 (0)