aboutsummaryrefslogtreecommitdiff
path: root/unused.jai
diff options
context:
space:
mode:
Diffstat (limited to 'unused.jai')
-rw-r--r--unused.jai15
1 files changed, 15 insertions, 0 deletions
diff --git a/unused.jai b/unused.jai
index 0425f8d..a8dddfc 100644
--- a/unused.jai
+++ b/unused.jai
@@ -40,6 +40,21 @@ print_database :: (db: Database) {
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- //
+
+// Average cumulative calculation.
+average: float64 = 0;
+counter: float64 = 0;
+t0 := current_time_monotonic();
+t1 := current_time_monotonic();
+set_cursor_position(2, 47);
+sample := cast(float64)to_nanoseconds(t1-t0)/1000;
+average = (sample + counter * average) / (counter + 1);
+counter += 1;
+print(">%us<", average);
+
+
+// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- //
+
// Implementation of tcsetattr, tcgetattr, and tcflush using only 'ioctl' which is provided by jai.
#if USE_LIBC {