diff options
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 { |
