◆ WaitForAsyncOp() [1/3]
| WaitForAsyncOp::WaitForAsyncOp |
( |
std::string |
name | ) |
|
|
explicit |
44 :
name(std::move(name_))
45{
46}
std::string name
Definition measure-load-performance-tests.cc:27
◆ WaitForAsyncOp() [2/3]
52{
53}
bool started
Definition measure-load-performance-tests.cc:29
struct timespec t
Definition measure-load-performance-tests.cc:30
◆ WaitForAsyncOp() [3/3]
58 ,
t(std::move(other.
t))
59{
60}
◆ ~WaitForAsyncOp()
| WaitForAsyncOp::~WaitForAsyncOp |
( |
| ) |
|
|
default |
◆ operator()()
| bool WaitForAsyncOp::operator() |
( |
| ) |
|
63{
64 if(!
started && 0 == clock_gettime(CLOCK_REALTIME, &
t))
65 {
67
69
70 std::cout <<
"Waiting for " <<
name << std::endl;
71 return true;
72 }
73
75 struct timespec now = {0, 0};
76 if(0 == clock_gettime(CLOCK_REALTIME, &now))
77 {
78 const double duration = now.tv_sec -
t.tv_sec + (now.tv_nsec -
t.tv_nsec) / 1E9;
79
80 std::cout <<
name <<
" took " << duration <<
"s" << std::endl;
81 }
82 return false;
83}
void P()
Definition semaphore.hh:38
void V()
Definition semaphore.hh:77
Scroom::Semaphore s
Definition measure-load-performance-tests.cc:28
ThreadPool::Ptr Sequentially()
Definition threadpoolimpl.cc:462
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ name
| std::string WaitForAsyncOp::name |
|
private |
◆ started
| bool WaitForAsyncOp::started {false} |
|
private |
| struct timespec WaitForAsyncOp::t = {0, 0} |
|
private |
The documentation for this class was generated from the following file: