Measure running time of Sync and Copy actions
This commit is contained in:
28
src/main.c
28
src/main.c
@@ -109,6 +109,8 @@ int Sync(char *pathLeft, char *pathRight, int reCheck, int dryRun) {
|
|||||||
PrintElapsedTime(tBuild);
|
PrintElapsedTime(tBuild);
|
||||||
Print("\n");
|
Print("\n");
|
||||||
|
|
||||||
|
int postCheckDir = 0;
|
||||||
|
long long tRun = Time_GetTime();
|
||||||
if (dryRun) {
|
if (dryRun) {
|
||||||
// Show action list
|
// Show action list
|
||||||
ActionFileNode_Print(actionFileNode);
|
ActionFileNode_Print(actionFileNode);
|
||||||
@@ -117,10 +119,18 @@ int Sync(char *pathLeft, char *pathRight, int reCheck, int dryRun) {
|
|||||||
// Run action list
|
// Run action list
|
||||||
if (ActionFileNode_RunList(actionFileNode, pathLeft, pathRight)) {
|
if (ActionFileNode_RunList(actionFileNode, pathLeft, pathRight)) {
|
||||||
PrintStatistics(actionFileNode, ActionFileNodeResult_Ok);
|
PrintStatistics(actionFileNode, ActionFileNodeResult_Ok);
|
||||||
CheckDir(pathLeft, reCheck);
|
postCheckDir = 1;
|
||||||
CheckDir(pathRight, reCheck);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tRun = Time_GetTime() - tRun;
|
||||||
|
Print("\ttRun:");
|
||||||
|
PrintElapsedTime(tRun);
|
||||||
|
Print("\n");
|
||||||
|
|
||||||
|
if (postCheckDir) {
|
||||||
|
CheckDir(pathLeft, reCheck);
|
||||||
|
CheckDir(pathRight, reCheck);
|
||||||
|
}
|
||||||
|
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
@@ -157,6 +167,8 @@ int Copy(char *pathLeft, char *pathRight, int reCheck, int dryRun) {
|
|||||||
PrintElapsedTime(tBuild);
|
PrintElapsedTime(tBuild);
|
||||||
Print("\n");
|
Print("\n");
|
||||||
|
|
||||||
|
int postCheckDir = 0;
|
||||||
|
long long tRun = Time_GetTime();
|
||||||
if (dryRun) {
|
if (dryRun) {
|
||||||
// Show action list
|
// Show action list
|
||||||
ActionFileNode_Print(actionFileNode);
|
ActionFileNode_Print(actionFileNode);
|
||||||
@@ -165,10 +177,18 @@ int Copy(char *pathLeft, char *pathRight, int reCheck, int dryRun) {
|
|||||||
// Run action list
|
// Run action list
|
||||||
if (ActionFileNode_RunList(actionFileNode, pathLeft, pathRight)) {
|
if (ActionFileNode_RunList(actionFileNode, pathLeft, pathRight)) {
|
||||||
PrintStatistics(actionFileNode, ActionFileNodeResult_Ok);
|
PrintStatistics(actionFileNode, ActionFileNodeResult_Ok);
|
||||||
CheckDir(pathLeft, reCheck);
|
postCheckDir = 1;
|
||||||
CheckDir(pathRight, reCheck);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tRun = Time_GetTime() - tRun;
|
||||||
|
Print("\ttRun:");
|
||||||
|
PrintElapsedTime(tRun);
|
||||||
|
Print("\n");
|
||||||
|
|
||||||
|
if (postCheckDir) {
|
||||||
|
CheckDir(pathLeft, reCheck);
|
||||||
|
CheckDir(pathRight, reCheck);
|
||||||
|
}
|
||||||
|
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user