That Terminal
A terminal emulator designed for video making purposes.
clock.cc File Reference

Time handling interface. More...

#include <chrono>
#include <mutex>
#include <condition_variable>
#include <thread>
Include dependency graph for clock.cc:

Functions

double GetTime ()
 
void AdvanceTime (double seconds)
 
void SleepFor (double seconds)
 
void SetTimeFactor (double factor)
 
void TimeTerminate ()
 

Detailed Description

Time handling interface.

Function Documentation

◆ AdvanceTime()

void AdvanceTime ( double  seconds)

Advances time. Used when TimeFactor is set to 0. Ignored otherwise.

Parameters
secondsNumber of seconds to advance.

◆ GetTime()

double GetTime ( )
Returns
the number of seconds elapsed since the program started.

◆ SetTimeFactor()

void SetTimeFactor ( double  factor)

Changes the flow of time.

Parameters
factorHas the following meanings:
0 = time advances only with AdvanceTime
1 = normal time
>0 = normal time, but scaled by the given factor (i.e. 2 = time goes twice as fast as realtime)

◆ SleepFor()

void SleepFor ( double  seconds)

Puts this thread into sleep for given time. If timefactor=0, another thread must call AdvanceTime in order for this thread to wake.

Parameters
secondsTime to sleep for, in seconds

◆ TimeTerminate()

void TimeTerminate ( )

Terminates any background process/thread started by the clock module.