Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Stroika::Foundation::Execution::WhenTimeExceeded Struct Reference

#include <WhenTimeExceeded.h>

Public Member Functions

 WhenTimeExceeded (Time::DurationSeconds callIfTakesLongerThan, nullptr_t f)
 

Detailed Description

Note
callIfTakesLongerThan is compared <=, so you can pass in zero to always trigger.
Example Usage
WhenTimeExceeded whenTimeExceeded{1.0s, [] (DurationSeconds timeTaken) { Logger::sThe.Log (Logger::eWarning, "Took along time to do 'x'"); }};
void Log(Priority logLevel, const wchar_t *format,...)
Definition Logger.inl:27
Note
this can be hopefully, mostly, optimized away if passed a nullptr_t constructor argument, or perhaps even if passed a null value of f

Definition at line 28 of file WhenTimeExceeded.h.

Constructor & Destructor Documentation

◆ WhenTimeExceeded()

Stroika::Foundation::Execution::WhenTimeExceeded::WhenTimeExceeded ( Time::DurationSeconds  callIfTakesLongerThan,
nullptr_t  f 
)

note - the called function f can be nullptr, in which case this does nothing.

Definition at line 12 of file WhenTimeExceeded.inl.


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