From 05af41d21d74d24871507e6f8f50574ea08c48a2 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 23 Sep 2019 15:38:25 -0400 Subject: Simple test profiling (#1062) * First pass support for performance profiling * Test across all elements * Fix bug - sourceContents is not used, should use rawSource. * * Add ability to get prelude from API. * Allow specifying source language for render-test * Made it possible to compile a test input file as C++ * Special handling for reflection * Added C++ impl to performance-profile.slang * Remove some clang warnings. * Output profile timings on appveyor and other TC. * Remove passing around of StdWriters (can use global). Small comment improvements. --- source/core/unix/slang-unix-process-util.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/core/unix') diff --git a/source/core/unix/slang-unix-process-util.cpp b/source/core/unix/slang-unix-process-util.cpp index 400f4f773..ab4366b06 100644 --- a/source/core/unix/slang-unix-process-util.cpp +++ b/source/core/unix/slang-unix-process-util.cpp @@ -15,6 +15,8 @@ #include #include +#include + namespace Slang { @@ -247,4 +249,17 @@ namespace Slang { return SLANG_FAIL; } + +/* static */uint64_t ProcessUtil::getClockFrequency() +{ + return 1000000000; +} + +/* static */uint64_t ProcessUtil::getClockTick() +{ + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + return now.tv_sec + now.tv_nsec; +} + } // namespace Slang -- cgit v1.2.3