SHARE
TWEET

/bm (benchmark)

Seb May 7th, 2011 (edited) 278 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #/bm (benchmark)
  2. # alias to evaluate and calculate command speed
  3. # Original author: Tom- (SwiftIRC)
  4. ###############################################
  5.  
  6. alias bm {
  7.   var %out $iif($regex($1,/^\-.?m/),say,echo),%bm $iif($left($1,1) == -,$2-,$1-),%c $regex($1,/^\-.?c/)
  8.   if (%bm) {
  9.     var %x $iif(%c,10000,1),%t $ticks
  10.     while (%x) {
  11.       scon -r noop $replace(%bm,$chr(124),$chr(124) scon -r noop)
  12.       dec %x
  13.     }
  14.     var %t $bytes($calc($ticks - %t),b)
  15.     %out $qt(%bm) $iif(%c,x10000) 7== $eval(%bm,2) $+(14,$chr(40),%t $+ ms,14,$chr(41))
  16.   }
  17. }
RAW Paste Data
Top