#include <iostream>
#include <chrono>
#include <cmath>
using namespace std;
using std::chrono::high_resolution_clock;
using std::chrono::nanoseconds;
using std::chrono::duration_cast;
inline int size() {
return 1000;
}
double shit = 0.2;
void do_work() {
shit += sin(shit);
}
int main() {
auto t1 = high_resolution_clock::now();
for ( int i=size(); i--; ) do_work();
auto t2 = high_resolution_clock::now();
for ( int i = 0; i < size(); ++i ) do_work();
auto t3 = high_resolution_clock::now();
auto timer1 = duration_cast<nanoseconds>(t2 - t1).count();
auto timer2 = duration_cast<nanoseconds>(t3 - t2).count();
cout << timer1 << ", " << timer2 << ", " << shit;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y2hyb25vPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnVzaW5nIHN0ZDo6Y2hyb25vOjpoaWdoX3Jlc29sdXRpb25fY2xvY2s7CnVzaW5nIHN0ZDo6Y2hyb25vOjpuYW5vc2Vjb25kczsKdXNpbmcgc3RkOjpjaHJvbm86OmR1cmF0aW9uX2Nhc3Q7CgppbmxpbmUgaW50IHNpemUoKSB7CglyZXR1cm4gMTAwMDsKfQoKZG91YmxlIHNoaXQgPSAwLjI7CnZvaWQgZG9fd29yaygpIHsKCXNoaXQgKz0gc2luKHNoaXQpOwp9CgppbnQgbWFpbigpIHsKCWF1dG8gdDEgPSBoaWdoX3Jlc29sdXRpb25fY2xvY2s6Om5vdygpOwoJZm9yICggaW50IGk9c2l6ZSgpOyBpLS07ICkgZG9fd29yaygpOwoJYXV0byB0MiA9IGhpZ2hfcmVzb2x1dGlvbl9jbG9jazo6bm93KCk7Cglmb3IgKCBpbnQgaSA9IDA7IGkgPCBzaXplKCk7ICsraSApIGRvX3dvcmsoKTsKCWF1dG8gdDMgPSBoaWdoX3Jlc29sdXRpb25fY2xvY2s6Om5vdygpOwoJYXV0byB0aW1lcjEgPSBkdXJhdGlvbl9jYXN0PG5hbm9zZWNvbmRzPih0MiAtIHQxKS5jb3VudCgpOwoJYXV0byB0aW1lcjIgPSBkdXJhdGlvbl9jYXN0PG5hbm9zZWNvbmRzPih0MyAtIHQyKS5jb3VudCgpOwoJY291dCA8PCB0aW1lcjEgPDwgIiwgIiA8PCB0aW1lcjIgPDwgIiwgIiA8PCBzaGl0OwoJcmV0dXJuIDA7Cn0=