HEBench
|
#include <hebench_report_cpp.h>
Public Types | |
enum class | TimeUnit { Default , Seconds , MilliSeconds , Microseconds , Nanoseconds } |
Static Public Member Functions | |
static constexpr TimeUnit | getPrefix (char ch_prefix) |
static constexpr char | getPrefix (TimeUnit unit) |
static void | setTimingPrefix (TimingPrefixedSeconds &prefix, double seconds, char ch_prefix) |
Converts the time in seconds to the specified time unit. More... | |
static void | setTimingPrefix (TimingPrefixedSeconds &prefix, double seconds, TimeUnit unit) |
static void | computeTimingPrefix (TimingPrefixedSeconds &prefix, double seconds) |
Given a time interval in seconds, computes the timing prefix. More... | |
Definition at line 20 of file hebench_report_cpp.h.
Enumerator | |
---|---|
Default | |
Seconds | |
MilliSeconds | |
Microseconds | |
Nanoseconds |
Definition at line 23 of file hebench_report_cpp.h.
|
static |
Given a time interval in seconds, computes the timing prefix.
prefix | |
seconds |
The timing prefix is the conversion of the time interval in seconds to the metric scale that best suits the measurement such that the time is in the range [1, 1000)
. The only prefixes supported are milli, micro, and nano. Thus, the ranges for just seconds is [0] U [1, infinite)
, and for nano is (0, 1000)
.
For example:
Definition at line 64 of file hebench_report_cpp.cpp.
|
inlinestaticconstexpr |
Definition at line 32 of file hebench_report_cpp.h.
|
inlinestaticconstexpr |
Definition at line 57 of file hebench_report_cpp.h.
|
static |
Converts the time in seconds to the specified time unit.
[out] | prefix | Structure where to store the result. |
[in] | seconds | Time in seconds for which to compute prefix. |
[in] | ch_prefix | Time unit prefix specification. See details. |
Given a timing in seconds and the metric prefix, this function will compute the corresponding value.
Values for ch_prefix
are:
0: behaves as computeTimingPrefix() ‘'s’: result is in seconds.
'm': result is in milliseconds.
'u': result is in microseconds.
'n'`: result is in nanoseconds.
Any other value makes the function return a failure.
For example, if seconds
is 0.05
and ch_prefix
is m
, then, the result is:
Definition at line 59 of file hebench_report_cpp.cpp.
|
inlinestatic |
Definition at line 111 of file hebench_report_cpp.h.