Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

STRATA_TRACE: print elapsed milliseconds on each request step

Niko122191d4d7ff8628
diff --git a/src/program/generate.cpp b/src/program/generate.cpp
index 0b153ee16..56c2136a8 100644
--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -11026,7 +11026,11 @@ int main(int argc, char** argv) {
const bool trace = std::getenv("STRATA_TRACE") != nullptr;
auto tr = [&](const char* what, long long a = -1, long long b = -1) {
if (!trace) return;
- std::fprintf(stderr, "strata trace: %s %lld %lld\n", what, a, b);
+ static thread_local Clock::time_point t0;
+ static thread_local bool t0_set = false;
+ if (!t0_set) { t0 = Clock::now(); t0_set = true; }
+ const double ms = std::chrono::duration<double, std::milli>(Clock::now() - t0).count();
+ std::fprintf(stderr, "strata trace: %s %lld %lld %.1f ms\n", what, a, b, ms);
std::fflush(stderr);
};
{