#include "test_common.hpp"
#include <cstdint>
#include <unistd.h>
#include <memory>
#include <mutex>
#include <openvpn/time/cputime.hpp>
#include <algorithm>
Go to the source code of this file.
|
#define | DEBUG_DUMP(msg, st, en, rt, chst, chen, chrt, md) |
|
#define | MEASURE(v, chkv, thread) |
|
#define | CALCULATE(msg, st, en, rt, chst, chen, chrt, md) |
|
|
typedef std::shared_ptr< std::thread > | ThreadPtr |
|
◆ CALCULATE
#define CALCULATE |
( |
|
msg, |
|
|
|
st, |
|
|
|
en, |
|
|
|
rt, |
|
|
|
chst, |
|
|
|
chen, |
|
|
|
chrt, |
|
|
|
md |
|
) |
| |
Value: double rt = en - st; \
double chrt = chen - chst; \
double md = std::max(rt, chrt) - std::min(rt, chrt); \
DEBUG_DUMP(
msg, st, en, rt, chst, chen, chrt, md)
Definition at line 64 of file test_cpu_time.cpp.
◆ DEBUG_DUMP
#define DEBUG_DUMP |
( |
|
msg, |
|
|
|
st, |
|
|
|
en, |
|
|
|
rt, |
|
|
|
chst, |
|
|
|
chen, |
|
|
|
chrt, |
|
|
|
md |
|
) |
| |
◆ MEASURE
#define MEASURE |
( |
|
v, |
|
|
|
chkv, |
|
|
|
thread |
|
) |
| |
Value:
ASSERT_GE(v, 0); \
double chkv = static_cast<double>(time(NULL))
double cpu_time(const bool thread=false)
Definition at line 59 of file test_cpu_time.cpp.
◆ ThreadPtr
typedef std::shared_ptr<std::thread> ThreadPtr |
◆ update_thread_runtime()
void update_thread_runtime |
( |
double |
val | ) |
|
◆ thread_runtime
double thread_runtime = 0 |
◆ update_guard