HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes
tt::hires_utc_clock Struct Reference

#include <ttauri/hires_utc_clock.hpp>

Public Types

using rep = int64_t
 
using period = std::nano
 
using duration = std::chrono::duration<rep, period>
 
using time_point = std::chrono::time_point<hires_utc_clock>
 

Static Public Member Functions

static time_point now () noexcept
 Get the current time.
 
static time_point now (time_stamp_count &tsc) noexcept
 Get the current time and TSC value.
 
static time_point make (time_stamp_count const &tsc) noexcept
 Make a time point from a time stamp count.
 
static bool start_subsystem () noexcept
 This will start the calibration subsystem.
 
static void stop_subsystem () noexcept
 This will stop the calibration subsystem.
 
static void adjust_for_drift () noexcept
 A calibration step which will drift the per-cpu tsc-offset.
 

Static Public Attributes

static const bool is_steady = false
 

Detailed Description

Timestamp.

Member Function Documentation

◆ adjust_for_drift()

static void tt::hires_utc_clock::adjust_for_drift ( )
staticnoexcept

A calibration step which will drift the per-cpu tsc-offset.

This is a fast wait-free function that may be called from any thread. It is useful to call this from the render thread which means small adjustments to the calibrations are made at 60 fps.

◆ make()

static time_point tt::hires_utc_clock::make ( time_stamp_count const & tsc)
staticnoexcept

Make a time point from a time stamp count.

This function will work in two modes:

  • subsystem off: Uses now() and the time_stamp_count frequency to estimate a timepoint from the given tsc.
  • subsystem on: Uses the calibrated TSC offset and more accurate frequency to estimate a timepoint from the given tsc. this is much faster and a lot more accurate.

◆ now() [1/2]

static time_point tt::hires_utc_clock::now ( )
staticnoexcept

Get the current time.

◆ now() [2/2]

static time_point tt::hires_utc_clock::now ( time_stamp_count & tsc)
staticnoexcept

Get the current time and TSC value.

Precondition
Use set_thread_affinity() to set the CPU affinity to a single CPU.

◆ start_subsystem()

static bool tt::hires_utc_clock::start_subsystem ( )
staticnoexcept

This will start the calibration subsystem.

◆ stop_subsystem()

static void tt::hires_utc_clock::stop_subsystem ( )
staticnoexcept

This will stop the calibration subsystem.


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