Sorry for the terminolgy, I did mean simpler smile


But I must say, Your benchfwrite is off; you need to /fseek to the end of the file before you /fwrite to it smile

Code:
alias benchfwrite {
  .fopen bfw wfwtest.txt
  .fseek -n bfw $file(wfwtest.txt).size
  .fwrite bfw test
  .fclose bfw
}
alias benchwrite {
  write wfwtest.txt test
}



alias benchit {
  ;create the file so /fopen won't freak out
  /write wfwtest.txt

  var %x = $1, %t = $ticks
  while (%x) {
    benchfwrite
    dec %x
  }
  %t = $calc($ticks - %t)
  .remove wfwtest.txt

  ;so /write is on the same playing field as /fopen|seek|write|close
  /write wfwtest.txt

  var %y = $1, %u = $ticks
  while (%y) {
    benchwrite
    dec %y
  }
  %u = $calc($ticks - %u)
  .remove wfwtest.txt

  echo -s Results for /fwrite - Ilterations: $1 - Total Time: %t $+ ms - Avg Time: $calc(%t / $1) $+ ms
  echo -s Results for /write - Ilterations: $1 - Total Time: %u $+ ms - Avg Time: $calc(%u / $1) $+ ms

}


Code:
Results for /fwrite - Ilterations: 100000 - Total Time: 98719ms - Avg Time: 0.98719ms
Results for /write - Ilterations: 100000 - Total Time: 37235ms - Avg Time: 0.37235ms

Last edited by FroggieDaFrog; 12/11/11 04:51 AM.

I am SReject
My Stuff