SUNphi  1.0
Timer.hpp File Reference

Provides a timer which can be split. More...

Go to the source code of this file.

Classes

class  SUNphi::Timer
 

Typedefs

using SUNphi::Clock = std::chrono::steady_clock
 Machine clock type.
 
using SUNphi::Instant = std::chrono::time_point< Clock >
 Instant type, defining a moment in time.
 
using SUNphi::Duration = decltype(Instant{}-Instant{})
 Difference of time between two moments.
 

Functions

Instant SUNphi::takeTime ()
 Get current time.
 
template<typename U , typename O = double>
double SUNphi::durationIn (const Duration &duration)
 Convert duration into a units of measure. More...
 
template<typename O = double>
double SUNphi::durationInSec (const Duration &duration)
 Convert duration into seconds. More...
 
template<typename F , typename... Args>
auto SUNphi::durationOf (Duration &duration, F &&f, Args &&...args)
 Returns the duration of executing a function. More...
 
template<typename F , typename... Args>
Duration SUNphi::durationOf (F &&f, Args &&...args)
 

Variables

Timer SUNphi::timings
 Global timings.
 

Detailed Description

Provides a timer which can be split.

Definition in file Timer.hpp.

Function Documentation

template<typename U , typename O = double>
double SUNphi::durationIn ( const Duration duration)

Convert duration into a units of measure.

Parameters
durationInput duration

Definition at line 259 of file Timer.hpp.

template<typename O = double>
double SUNphi::durationInSec ( const Duration duration)

Convert duration into seconds.

Parameters
durationInput duration

Definition at line 267 of file Timer.hpp.

template<typename F , typename... Args>
auto SUNphi::durationOf ( Duration duration,
F &&  f,
Args &&...  args 
)

Returns the duration of executing a function.

Beginning instant

Store the result

Parameters
durationVariable where to store the duration
fFunction to execute
argsArguments to call

Definition at line 278 of file Timer.hpp.

template<typename F , typename... Args>
Duration SUNphi::durationOf ( F &&  f,
Args &&...  args 
)

Returns the duration of executing a function

Result of f() is discarded

Result to be returned

Parameters
fFunction to execute
argsArguments to call

Definition at line 302 of file Timer.hpp.