INF205/lab_2/15.cpp

24 lines
645 B
C++

#include <vector>
#include <chrono>
#include <fstream>
#include <iostream>
int main()
{
auto t0 = std::chrono::high_resolution_clock::now();
//std::ofstream myfile;
std::vector<int> list;
int data = 1024;
int n = 0;
while (true) {
n++;
list.push_back(data);
auto t1 = std::chrono::high_resolution_clock::now();
auto delta_t = std::chrono::duration_cast<std::chrono::microseconds>(t1-t0).count();
//myfile.open("15cpp.csv", std::ios::trunc);
//myfile << n << ", " << delta_t << "\n";
//myfile.close();
std::cout << n << ", " << delta_t << "\n";
}
}