diff --git a/Makefile b/Makefile index f7e87de..1c8460a 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,8 @@ endif ifeq ($(SUPERCOLLIDER), 1) SOURCES += src/SuperColliderEngine.cpp FLAGS += -Idep/supercollider/include -Idep/supercollider/include/common -Idep/supercollider/lang -Idep/supercollider/common -Idep/supercollider/include/plugin_interface -FLAGS += -DNDEBUG +FLAGS += -DNDEBUG # TODO is this OK? +# FLAGS += SC_VCV_ENGINE_TIMING # uncomment to turn on timing printing while running supercollider := dep/supercollider/build/lang/libsclang.a OBJECTS += $(supercollider) DEPS += $(supercollider) diff --git a/src/SuperColliderEngine.cpp b/src/SuperColliderEngine.cpp index f524107..80cf3e5 100644 --- a/src/SuperColliderEngine.cpp +++ b/src/SuperColliderEngine.cpp @@ -313,18 +313,21 @@ void SC_VcvPrototypeClient::fail(const std::string& msg) noexcept { _ok = false; } -// TODO test code +#ifdef SC_VCV_ENGINE_TIMING static long long int gmax = 0; static constexpr unsigned int nTimes = 1024; static long long int times[nTimes] = {}; static unsigned int timesIndex = 0; +#endif void SC_VcvPrototypeClient::evaluateProcessBlock(ProcessBlock* block) noexcept { - // TODO timing test code +#ifdef SC_VCV_ENGINE_TIMING auto start = std::chrono::high_resolution_clock::now(); +#endif auto* buf = buildScProcessBlockString(block); interpret(buf); readScProcessBlockResult(block); +#ifdef SC_VCV_ENGINE_TIMING auto end = std::chrono::high_resolution_clock::now(); auto ticks = (end - start).count(); @@ -340,6 +343,7 @@ void SC_VcvPrototypeClient::evaluateProcessBlock(ProcessBlock* block) noexcept { { printf("AVG TIME %lld\n", std::accumulate(std::begin(times), std::end(times), 0ull) / nTimes); } +#endif } int SC_VcvPrototypeClient::getResultAsInt(const char* text) noexcept {