JASSv2
Classes | Static Public Member Functions | Private Types | List of all members
JASS::timer Class Reference

General purpose cross-platform timer methods for C++11 and later. More...

#include <timer.h>

Classes

class  duration
 A duration as returned by a stop_watch. More...
 

Static Public Member Functions

static stop_watch start ()
 Start a stop watfh. More...
 
static duration stop (stop_watch watch)
 Return the time on the stop watch. More...
 
static void unittest (void)
 Unit test this class.
 

Private Types

typedef std::chrono::time_point< std::chrono::steady_clock, std::chrono::nanoseconds > stop_watch
 An instance of a timer.
 

Detailed Description

General purpose cross-platform timer methods for C++11 and later.

Member Function Documentation

◆ start()

static stop_watch JASS::timer::start ( )
inlinestatic

Start a stop watfh.

Returns
A stop watch object that is later passed to timer::stop()

◆ stop()

static duration JASS::timer::stop ( stop_watch  watch)
inlinestatic

Return the time on the stop watch.

Parameters
watch[in] The stop watch to check.
Returns
a duration that can be converted into a human-usable unit such as nanoseconds.

The documentation for this class was generated from the following file: