Loading...
Searching...
No Matches
XrdCephBuffer::Timer_ns Class Reference

`#include <BufferUtils.hh>`

Collaboration diagram for XrdCephBuffer::Timer_ns:

## Public Member Functions

| Timer_ns (long &output_ns)
| RAII based timer information outputing a long value of ns Almost trivial class to time something and to pass the duration as a long to an output variable (specified in the constructor) at destruction. Create the object to start the timer. The timer stops when its destructor is called. #TODO improve to template the output type and the time ratio.
| ~Timer_ns ()

## Detailed Description

Definition at line 32 of file BufferUtils.hh.

## Constructor & Destructor Documentation

## Timer_ns()

Timer_ns::Timer_ns | ( | long & | output_ns | ) |

explicit

RAII based timer information outputing a long value of ns Almost trivial class to time something and to pass the duration as a long to an output variable (specified in the constructor) at destruction. Create the object to start the timer. The timer stops when its destructor is called. #TODO improve to template the output type and the time ratio.

Definition at line 160 of file BufferUtils.cc.

: m_output_val(output)
{
m_start = std::chrono::steady_clock::now();
}

## ~Timer_ns()

Timer_ns::~Timer_ns | ( |  | ) |

Definition at line 165 of file BufferUtils.cc.

{
auto end = std::chrono::steady_clock::now();
m_output_val = std::chrono::duration_cast<std::chrono::nanoseconds>(end - m_start).count();
}

The documentation for this class was generated from the following files:

- BufferUtils.hh
- BufferUtils.cc