Measure running time of Sync and Copy actions

This commit is contained in:
2021-12-30 16:54:54 +01:00
parent e6a5b479a0
commit d1c17c48a8

View File

@@ -109,6 +109,8 @@ int Sync(char *pathLeft, char *pathRight, int reCheck, int dryRun) {
PrintElapsedTime(tBuild);
Print("\n");
int postCheckDir = 0;
long long tRun = Time_GetTime();
if (dryRun) {
// Show action list
ActionFileNode_Print(actionFileNode);
@@ -117,10 +119,18 @@ int Sync(char *pathLeft, char *pathRight, int reCheck, int dryRun) {
// Run action list
if (ActionFileNode_RunList(actionFileNode, pathLeft, pathRight)) {
PrintStatistics(actionFileNode, ActionFileNodeResult_Ok);
CheckDir(pathLeft, reCheck);
CheckDir(pathRight, reCheck);
postCheckDir = 1;
}
}
tRun = Time_GetTime() - tRun;
Print("\ttRun:");
PrintElapsedTime(tRun);
Print("\n");
if (postCheckDir) {
CheckDir(pathLeft, reCheck);
CheckDir(pathRight, reCheck);
}
return (1);
}
@@ -157,6 +167,8 @@ int Copy(char *pathLeft, char *pathRight, int reCheck, int dryRun) {
PrintElapsedTime(tBuild);
Print("\n");
int postCheckDir = 0;
long long tRun = Time_GetTime();
if (dryRun) {
// Show action list
ActionFileNode_Print(actionFileNode);
@@ -165,10 +177,18 @@ int Copy(char *pathLeft, char *pathRight, int reCheck, int dryRun) {
// Run action list
if (ActionFileNode_RunList(actionFileNode, pathLeft, pathRight)) {
PrintStatistics(actionFileNode, ActionFileNodeResult_Ok);
CheckDir(pathLeft, reCheck);
CheckDir(pathRight, reCheck);
postCheckDir = 1;
}
}
tRun = Time_GetTime() - tRun;
Print("\ttRun:");
PrintElapsedTime(tRun);
Print("\n");
if (postCheckDir) {
CheckDir(pathLeft, reCheck);
CheckDir(pathRight, reCheck);
}
return (1);
}