--- linuxsampler/trunk/src/scriptvm/CoreVMFunctions.cpp 2017/05/26 18:55:45 3222 +++ linuxsampler/trunk/src/scriptvm/CoreVMFunctions.cpp 2017/08/10 13:18:06 3345 @@ -15,6 +15,7 @@ #include #include "tree.h" #include "ScriptVM.h" +#include "../common/RTMath.h" namespace LinuxSampler { @@ -71,15 +72,17 @@ VMFnResult* CoreVMFunction_message::exec(VMFnArgs* args) { if (!args->argsCount()) return errorResult(); + uint64_t usecs = RTMath::unsafeMicroSeconds(RTMath::real_clock); + VMStringExpr* strExpr = dynamic_cast(args->arg(0)); if (strExpr) { - std::cout << "[ScriptVM] " << strExpr->evalStr() << "\n"; + printf("[ScriptVM %.3f] %s\n", usecs/1000000.f, strExpr->evalStr().c_str()); return successResult(); } VMIntExpr* intExpr = dynamic_cast(args->arg(0)); if (intExpr) { - std::cout << "[ScriptVM] " << intExpr->evalInt() << "\n"; + printf("[ScriptVM %.3f] %d\n", usecs/1000000.f, intExpr->evalInt()); return successResult(); } @@ -426,6 +429,14 @@ --m_index; return it; } + inline ArrExprIter& operator+=(difference_type d) { + m_index += d; + return *this; + } + inline ArrExprIter& operator-=(difference_type d) { + m_index -= d; + return *this; + } inline bool operator==(const ArrExprIter& other) const { return m_index == other.m_index; }