more precise timer

This commit is contained in:
Kaehvaman 2024-11-03 14:42:30 +04:00
parent 62c25a7564
commit 434b6306cc
2 changed files with 4 additions and 4 deletions

View File

@ -327,8 +327,8 @@ void createRandomBinFiles(int n, int size) {
int main() { int main() {
srand((unsigned int)time(NULL)); srand((unsigned int)time(NULL));
time_t start;
time(&start); clock_t start = clock();
//saveRandomArray(); //saveRandomArray();
@ -351,9 +351,9 @@ int main() {
//task5(); //task5();
createRandomBinFiles(1, 1024*1024); createRandomBinFiles(32, 32 * 1024);
printf_s("time = %.0lf seconds", difftime(time(NULL), start)); printf_s("time = %.3lf seconds", (double)(clock() - start) / (double)CLOCKS_PER_SEC);
return 0; return 0;
} }

Binary file not shown.