Question: I get error in this line in repl.it (#include ../include/stopwatch/Stopwatch.hpp). #include #include #include ../include/stopwatch/Stopwatch.hpp int main() { //Namespace alias namespace sw = stopwatch; //Create and

I get error in this line in repl.it (#include "../include/stopwatch/Stopwatch.hpp").

#include

#include

#include "../include/stopwatch/Stopwatch.hpp"

int main()

{

//Namespace alias

namespace sw = stopwatch;

//Create and start a stopwatch

sw::Stopwatch my_watch;

my_watch.start();

//Do something time-consuming

for(std::size_t i = 1; i <= 500000; i++){

if( i%10 == 0){

std::cout << i << std::endl;

}

if( i % 100000 == 0){

my_watch.lap();

}

}

//Get elapsed time..

// .. in seconds

std::uint64_t elapsed_s = my_watch.elapsed();

//Get lap times

auto laps = my_watch.elapsed_laps();

//Print to screen

std::cout << "---------------" << std::endl;

std::cout << elapsed_s << " s" << std::endl;

std::cout << "---------------" << std::endl;

std::cout << "Laps Total: " << laps.first << std::endl;

auto lap_times = laps.second;

std::cout << "Lap Times: " << sw::show_times(lap_times);

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!