const char* dstFileName, const char* srcFileName,
int compressionLevel)
{
+ UTIL_time_t const timeStart = UTIL_getTime();;
+ clock_t const cpuStart = clock();
+
U64 readsize = 0;
U64 compressedfilesize = 0;
U64 const fileSize = UTIL_getFileSize(srcFileName);
(unsigned long long)readsize, (unsigned long long) compressedfilesize,
dstFileName);
+ /* Elapsed Time and CPU Load */
+ { clock_t const cpuEnd = clock();
+ double const cpuLoad_s = (double)(cpuEnd - cpuStart) / CLOCKS_PER_SEC;
+ U64 const timeLength_ns = UTIL_clockSpanNano(timeStart);
+ double const timeLength_s = (double)timeLength_ns / 1000000000;
+ double const cpuLoad_pct = (cpuLoad_s / timeLength_s) * 100;
+ DISPLAYLEVEL(4, "%s: Completed in %.2f sec (cpu load : %.0f%%)\n",
+ srcFileName, timeLength_s, cpuLoad_pct);
+ }
return 0;
}
const char* srcFileName,
int compressionLevel)
{
- UTIL_time_t timeStart;
- clock_t cpuStart;
-
int closeDstFile = 0;
int result;
stat_t statbuf;
transfer_permissions = 1;
}
- timeStart = UTIL_getTime();
- cpuStart = clock();
-
result = FIO_compressFilename_internal(prefs, ress, dstFileName, srcFileName, compressionLevel);
if (closeDstFile) {
UTIL_setFileStat(dstFileName, &statbuf);
}
}
- { clock_t const cpuEnd = clock();
- double const cpuLoad_s = (double)(cpuEnd - cpuStart) / CLOCKS_PER_SEC;
- U64 const timeLength_ns = UTIL_clockSpanNano(timeStart);
- double const timeLength_s = (double)timeLength_ns / 1000000000;
- double const cpuLoad_pct = (cpuLoad_s / timeLength_s) * 100;
- DISPLAYLEVEL(4, "%s: Completed in %.2f sec (cpu load : %.0f%%)\n",
- srcFileName, timeLength_s, cpuLoad_pct);
- }
+
return result;
}