From 27e3e029448cf2a80b24e6e212dee8cccda06987 Mon Sep 17 00:00:00 2001 From: dam Date: Mon, 6 May 2024 13:05:12 +0100 Subject: WIP : Improve performance of draw_user_interface. --- unused.jai | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'unused.jai') diff --git a/unused.jai b/unused.jai index ab4f667..d016cb7 100644 --- a/unused.jai +++ b/unused.jai @@ -3,14 +3,19 @@ print(">%<", S64_MIN + delta, to_standard_error = true); // MEASURE PERFORMANCE { - #import "Basic"; - start := current_time_monotonic(); - // Code to measure. - stop := current_time_monotonic(); - print("Measured % ns.\n", to_nanoseconds(stop-start)); + dbg_average := 0; // DEBUG + dbg_count := 0; // DEBUG - // Cumulative average: - CA_n+1 = (x_n+1 + n*CA_n ) / (n + 1) + #import "Basic"; + + // Cumulative average: CA_n+1 = (x_n+1 + n*CA_n ) / (n + 1) + start := current_time_monotonic(); // DEBUG + // ...code to be measured... + stop := current_time_monotonic(); // DEBUG + dbg_sample := to_nanoseconds(stop-start); // DEBUG + dbg_average = (dbg_sample + dbg_count * dbg_average) / (dbg_count + 1); // DEBUG + dbg_count += 1; // DEBUG + print("Average % ns.\n", dbg_average); // DEBUG } // Memory allocator debugging. -- cgit v1.2.3