Skip to content

shiyuli/Stopwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stopwatch

Stopwatch is a simple, fast, cross-platform and header-only stopwatch for C++.

Build Status

Build status

Test

sudo sh ./test.sh
./test

Usage

  • include header

    #include "stopwatch.hpp"
  • instantiate a class in stack

    Stopwatch stopwatch;
  • start stopwatch

    stopwatch.start();
  • split and get duration

    std::cout << "duration: " << stopwatch.split() << " seconds" << std::endl;

    or

    duration_t duration = stopwatch.split_raw();
    std::cout << "duration: " << duration.count() << " seconds" << std::endl;
  • get current time

    std::cout << "current_time: " << Stopwatch::now << std::endl;
  • get splits

    std::cout << stopwatch.splits() << std::endl;
  • stop stopwatch

    stopwatch.stop();

About

Header only C++ stopwatch implementation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published