| 70 | |
| 71 | template <typename T> |
| 72 | void loopForDuration(T duration = boost::chrono::seconds(2)) { |
| 73 | typedef boost::chrono::steady_clock clock; |
| 74 | auto start = clock::now(); |
| 75 | do { |
| 76 | oneLoop(); |
| 77 | } while (clock::now() - start < duration); |
| 78 | } |
| 79 | |
| 80 | ~ClientMainloopThread() { |
| 81 | m_run = false; |