mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
Add code to support 'display_processing_time' use (#3095)
* Add code to support using 'display_processing_time' for functional performance * Cleanup use of getFunctionName() so this is only called once and re-used
This commit is contained in:
parent
84a141b1d6
commit
518b152c4c
2 changed files with 2138 additions and 108 deletions
2229
src/sync.d
2229
src/sync.d
File diff suppressed because it is too large
Load diff
17
src/util.d
17
src/util.d
|
|
@ -1562,4 +1562,21 @@ void setPathTimestamp(bool dryRun, string inputPath, SysTime newTimeStamp) {
|
|||
// display the error message
|
||||
displayFileSystemErrorMessage(e.msg, getFunctionName!({}));
|
||||
}
|
||||
}
|
||||
|
||||
// Generate the initial function processing time log entry
|
||||
void displayFunctionProcessingStart(string functionName, string logKey) {
|
||||
// Output the function processing header
|
||||
addLogEntry(format("[%s] Application Function '%s' Started", strip(logKey), strip(functionName)));
|
||||
}
|
||||
|
||||
// Calculate the time taken to perform the application Function
|
||||
void displayFunctionProcessingTime(string functionName, SysTime functionStartTime, SysTime functionEndTime, string logKey) {
|
||||
// Calculate processing time
|
||||
auto functionDuration = functionEndTime - functionStartTime;
|
||||
double functionDurationAsSeconds = (functionDuration.total!"msecs"/1e3); // msec --> seconds
|
||||
|
||||
// Output the function processing time
|
||||
string processingTime = format("[%s] Application Function '%s' Processing Time = %.4f Seconds", strip(logKey), strip(functionName), functionDurationAsSeconds);
|
||||
addLogEntry(processingTime);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue