diff options
| author | dam <dam@gudinoff> | 2024-05-03 00:32:06 +0100 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2024-05-03 00:32:06 +0100 |
| commit | 8b312bad33617f9b718232141d2855d80cb8b912 (patch) | |
| tree | 61880bef9e6b2c8200091cc365927b68878f9996 /unused.jai | |
| parent | 66dfee359cbe2c18ce8400edeb801a2373a771f4 (diff) | |
| download | task-time-tracker-8b312bad33617f9b718232141d2855d80cb8b912.tar.zst task-time-tracker-8b312bad33617f9b718232141d2855d80cb8b912.zip | |
WIP : Cleaning up TUI module.
Diffstat (limited to 'unused.jai')
| -rw-r--r-- | unused.jai | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 { |
