aboutsummaryrefslogtreecommitdiff
path: root/unused.jai
diff options
context:
space:
mode:
authordam <dam@gudinoff>2024-05-06 13:05:12 +0100
committerdam <dam@gudinoff>2024-05-06 13:05:12 +0100
commit27e3e029448cf2a80b24e6e212dee8cccda06987 (patch)
treec15adfbdf326d4f1ba5de2c0e0223a2d635461aa /unused.jai
parent65227c476071914b82720084a2a775b44e4de885 (diff)
downloadtask-time-tracker-27e3e029448cf2a80b24e6e212dee8cccda06987.tar.zst
task-time-tracker-27e3e029448cf2a80b24e6e212dee8cccda06987.zip
WIP : Improve performance of draw_user_interface.
Diffstat (limited to 'unused.jai')
-rw-r--r--unused.jai19
1 files changed, 12 insertions, 7 deletions
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.