hardware_timestamp_measurement_start hardware_timestamp_measurement_stop

Synopsis

Declared in <folly/chrono/Hardware.h>

uint64_t
hardware_timestamp_measurement_start() noexcept;

Description

Suitable for beginning precise measurement of a region of code.

Prevents the compiler from reordering instructions across the call. This is in contrast with hardware_timestamp(), which may not prevent the compiler from reordering instructions across the call.

Prevents the processor from pipelining the call with loads. This is in contrast with hardware_timestamp(), which allows the processor to pipeline the call with surrounding loads.

Does not prevent instruction pipelines from continuing execution across the call. For example, does not prevent a store issued before the call from continuing execution (becoming globally visible) across the call. This means that this form may not be suitable for certain measurement use‐cases which would require such prevention. However, this would be suitable for typical measurement use‐cases which do not specifically need to measure background work such as store execution.

Return Value

A hardware timestamp taken at the start of a measurement.

Created with MrDocs