Help for this page

Select Code to Download


  1. or download this
    Benchmark: running Time::HiRes::time, time, each for at least 1 CPU se
    +conds...
    Time::HiRes::time:  2 wallclock secs ( 0.82 usr +  0.22 sys =  1.04 CP
    +U) @ 1071260.58/s (n=1114111)
    ...
                           Rate Time::HiRes::time              time
    Time::HiRes::time 1071261/s                --              -41%
    time              1816839/s               70%                --
    
  2. or download this
    ($counter += 1) %= 5;    # 0, 1, 2, 3, 4, 0, 1, 2..4, 0..4, 0..4, ...
    ($counter += 1) %= 256;  # 0..255, 0..255, ...