HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
src
ttauri
audio_counter_clock.hpp
1
// Copyright Take Vos 2019.
2
// Distributed under the Boost Software License, Version 1.0.
3
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5
#pragma once
6
7
#include "os_detect.hpp"
8
#include <chrono>
9
#if TT_COMPILER == TT_CC_MSVC
10
#include <intrin.h>
11
#elif TT_COMPILER == TT_CC_CLANG
12
#include <x86intrin.h>
13
#elif TT_COMPILER == TT_CC_GCC
14
#include <x86intrin.h>
15
#endif
16
17
namespace
tt {
18
19
struct
audio_counter_clock
{
20
using
rep = uint64_t;
21
// Technically not nano-seconds, this just a counter.
22
using
period
=
std::nano
;
23
using
duration
=
std::chrono::duration<rep, period>
;
24
using
time_point
=
std::chrono::time_point<audio_counter_clock>
;
25
static
const
bool
is_steady =
true
;
26
27
static
audio_counter_clock::time_point
from_audio_api(uint64_t value)
noexcept
;
28
29
static
audio_counter_clock::time_point
now()
noexcept
;
30
};
31
32
}
tt::audio_counter_clock
Definition
audio_counter_clock.hpp:19
std::chrono::duration< rep, period >
std::nano
std::chrono::time_point
Generated on Mon Apr 22 2024 12:53:51 for HikoGUI by
1.10.0