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);
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user