diff options
Diffstat (limited to '3rdparty/bx/tests/os_test.cpp')
-rw-r--r-- | 3rdparty/bx/tests/os_test.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/3rdparty/bx/tests/os_test.cpp b/3rdparty/bx/tests/os_test.cpp index e6aeb314fbe..1589416e543 100644 --- a/3rdparty/bx/tests/os_test.cpp +++ b/3rdparty/bx/tests/os_test.cpp @@ -5,6 +5,8 @@ #include "test.h" #include <bx/os.h> +#include <bx/semaphore.h> +#include <bx/timer.h> TEST_CASE("getProcessMemoryUsed", "") { @@ -12,9 +14,15 @@ TEST_CASE("getProcessMemoryUsed", "") // DBG("bx::getProcessMemoryUsed %d", bx::getProcessMemoryUsed() ); } -TEST_CASE("getTempPath", "") +TEST_CASE("semaphore_timeout", "") { - char tmpDir[512]; - uint32_t len = BX_COUNTOF(tmpDir); - REQUIRE(bx::getTempPath(tmpDir, &len) ); + bx::Semaphore sem; + + int64_t start = bx::getHPCounter(); + bool ok = sem.wait(900); + int64_t elapsed = bx::getHPCounter() - start; + int64_t frequency = bx::getHPFrequency(); + double ms = double(elapsed) / double(frequency) * 1000; + printf("%f\n", ms); + REQUIRE(!ok); } |