alias benchmark {
var %time = $calc($ticks + 1016),%t
while ($ticks <= %time) { inc %t }
if (!$isid) say My silly computer can inc a variable %t times in $calc(1000 - ($ticks - %time)) $+ ms ;(
else return %t
}
alias benchmark2 {
var %s = 1
var %time = $calc($ticks + 1016),%t
while ($ticks <= %time) {
var %s = $calc(%s * 2)
inc %t
}
if (!$isid) say My silly computer can sequentially double a variable (starting from 1) %t times in $calc(1000 - ($ticks - %time)) $+ ms ;]
else return %t
}
alias benchmark3 {
var %s = 1
var %time = $calc($ticks + 1016),%t
while ($ticks <= %time) {
.echo -q $calc(%s * 3.14159)
inc %s
inc %t
}
if (!$isid) say My silly computer can calculate the circumferance for %t circles with consecutive diameters (starting from 1 and consisting of whole numbers) in $calc(1000 - ($ticks - %time)) $+ ms ;]
else return %t
}