-
Notifications
You must be signed in to change notification settings - Fork 1
Time, ticks and clocks
The wrapper has a small, std::chrono like library for clock handling.
In order to use this library, the scorep_clock policy is required.
As the exact unit, pace and origin of the clock given by Score-P is undefined, timestamps are taken in scorep::chrono::ticks. These ticks are sadly a step back from std::chrono::time_point and std::chromo::duration, as they can be used to represent both. However, as there is no notion of unit, pace and origin, that is not easily doable.
The scorep::chrono::measurement_clock is a clock equivalent to std::chrono::steady_clock. It provides a now() method which returns scorep::chrono::ticks.
Note:
This clock can only be used, after the clock function handler was called from the plugin interface. This is especially not the case in the constructor of the plugin, i.e., you cannot use this in the constructor.
auto start_timepoint = scorep::chrono::measurement_clock::now();If you have external data with another clock, you may need to convert the timestamps between the different clocks. Clocks may differ in their epoch and their resolution. For this common task, you can use the class scorep::chrono::time_convert.