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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started