Zone is an RAII struct that records precise time at its construction and destruction.
Realtime:
Recording is very lightweight, without any complicated logic or heap allocations.
This allows to use Tharsis-prof as a 'short-term profiler' that can record profiling
data over the duration of a few frames and be detect bottlenecks in real time. Game
code can then react, for example by disabling resource intensive nonessential features
(e.g. particle systems).
Precision:
Tharsis.prof measures time in D 'hectonanoseconds', or tenths of a microsecond. This is
precise enough to detect irregular overhead during frames but not to profile individual
instructions in a linear algebra function. Such use cases are better covered by
a Callgrind or a sampling profiler such as perf or CodeAnalyst. Also note that some
platforms may not provide access to high-precision timers and the results may be even
less precise. At least Linux, Windows and OSX should be alright, though.
Functionality needed to record profiling data.
Profiler keeps track of profiling events.
Zone is an RAII struct that records precise time at its construction and destruction.
Realtime:
Recording is very lightweight, without any complicated logic or heap allocations. This allows to use Tharsis-prof as a 'short-term profiler' that can record profiling data over the duration of a few frames and be detect bottlenecks in real time. Game code can then react, for example by disabling resource intensive nonessential features (e.g. particle systems).
Precision:
Tharsis.prof measures time in D 'hectonanoseconds', or tenths of a microsecond. This is precise enough to detect irregular overhead during frames but not to profile individual instructions in a linear algebra function. Such use cases are better covered by a Callgrind or a sampling profiler such as perf or CodeAnalyst. Also note that some platforms may not provide access to high-precision timers and the results may be even less precise. At least Linux, Windows and OSX should be alright, though.