c++ benchmark

This commit is contained in:
2024-08-11 00:03:33 +03:00
parent f1d2f49f3c
commit 519053708d
3 changed files with 30 additions and 0 deletions

24
code/C++/benchmark.cpp Normal file
View File

@@ -0,0 +1,24 @@
/**
* Время выполнения операции в секундах
*/
#include <bits/stdc++.h>
#include <iostream>
int main(int argc, char const *argv[]) {
time_t start, end;
long addition;
time(&start);
for (int i = 0; i < 20000; i++) {
for (int j = 0; j < 20000; j++)
;
}
time(&end);
std::cout << "Total " << difftime(end, start) << " seconds" << std::endl;
return EXIT_SUCCESS;
}