Ninja
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Stopwatch Struct Reference

A simple stopwatch which returns the time in seconds since Restart() was called. More...

#include <metrics.h>

Public Member Functions

double Elapsed () const
 Seconds since Restart() call. More...
 
void Restart ()
 
 Stopwatch ()
 

Private Member Functions

uint64_t NowRaw () const
 

Private Attributes

uint64_t started_
 

Detailed Description

A simple stopwatch which returns the time in seconds since Restart() was called.

Definition at line 65 of file metrics.h.

Constructor & Destructor Documentation

◆ Stopwatch()

Stopwatch::Stopwatch ( )
inline

Definition at line 67 of file metrics.h.

Member Function Documentation

◆ Elapsed()

double Stopwatch::Elapsed ( ) const

Seconds since Restart() call.

Definition at line 102 of file metrics.cc.

◆ NowRaw()

uint64_t Stopwatch::NowRaw ( ) const
private

Definition at line 107 of file metrics.cc.

Referenced by Restart().

◆ Restart()

void Stopwatch::Restart ( )
inline

Definition at line 72 of file metrics.h.

References NowRaw(), and started_.

Member Data Documentation

◆ started_

uint64_t Stopwatch::started_
private

Definition at line 75 of file metrics.h.

Referenced by Restart().


The documentation for this struct was generated from the following files: