mirror of
https://github.com/XRPLF/clio.git
synced 2026-04-29 15:37:53 +00:00
19 lines
431 B
C++
19 lines
431 B
C++
#pragma once
|
|
|
|
#include <chrono>
|
|
#include <functional>
|
|
|
|
namespace tests::common::util {
|
|
|
|
/**
|
|
* @brief Run a function with a timeout. If the function does not complete within the timeout, the
|
|
* test will fail.
|
|
*
|
|
* @param timeout The timeout duration
|
|
* @param function The function to run
|
|
*/
|
|
void
|
|
callWithTimeout(std::chrono::steady_clock::duration timeout, std::function<void()> function);
|
|
|
|
} // namespace tests::common::util
|