avoid division by zero if host fs hyperload is used which loads instantly

This commit is contained in:
Irmen de Jong 2023-02-08 01:37:49 +01:00
parent 79d0fb0b52
commit 7b59bc8d12

View File

@ -10,6 +10,10 @@ main {
const ubyte REPEATS = 2 const ubyte REPEATS = 2
sub print_speed(uword jiffies) { sub print_speed(uword jiffies) {
if jiffies==0 {
txt.print("\n 0 jiffies measured, speed is extremely high\n")
return
}
float speed = 65536.0 * REPEATS / (jiffies as float / 60.0) float speed = 65536.0 * REPEATS / (jiffies as float / 60.0)
txt.nl() txt.nl()
txt.print_uw(jiffies) txt.print_uw(jiffies)