25 lines
426 B
C++
25 lines
426 B
C++
/**
|
|
* Время выполнения операции в секундах
|
|
*/
|
|
|
|
#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;
|
|
}
|