#include <iostream>
#include <chrono>
#include <cstdlib>
using namespace std;
int main()
{
bool hasFollowPath = true;
bool updateLook;
auto t1 = std::chrono::high_resolution_clock::now();
for(int i=0; i<1000; ++i){
if(((std::rand() % 10 ) + 1) <= 7){
if(!hasFollowPath){
updateLook = false;
}
}
}
auto t2 = std::chrono::high_resolution_clock::now();
auto duration1 = std::chrono::duration_cast<std::chrono::microseconds>( t2 - t1 ).count();
std::cout << "Option #1: " << duration1 << "\n";
auto t3 = std::chrono::high_resolution_clock::now();
for(int i=0; i<1000; ++i){
if(!hasFollowPath){
if(((std::rand() % 10 ) + 1) <= 7){
updateLook = false;
}
}
}
auto t4 = std::chrono::high_resolution_clock::now();
auto duration2 = std::chrono::duration_cast<std::chrono::microseconds>( t4 - t3 ).count();
std::cout << "Option #2: " << duration2;
return 0;
}