Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago