Simple Benchmark script

Reply

Join Date: Aug 2004
Posts: 140
Reputation: Mahen is an unknown quantity at this point 
Solved Threads: 2
Mahen Mahen is offline Offline
Junior Poster

Simple Benchmark script

 
0
  #1
Jun 28th, 2009
Hello all,

I have been working with Linux a lot and i find myself installing a lot of linux distros, but with no way to test them.....

So i crafted a script in Perl to quickly create a lot of files on the Hard Disk and delete them. The script will count the number of milliseconds it took from start till deletion of all the files....

For example, on my home pc, with IDE Drives, it took ~800ms, on my laptop (SATA) ~200ms and on an old pentium 1.4ghz, fresh install - ~400ms

  1. use Time::HiRes qw[gettimeofday tv_interval];
  2. use File::Path;
  3. if (-e "test")
  4. {
  5. system("rm -rf test");
  6. }
  7. $timedata = [gettimeofday()];
  8. mkdir "test" or die $!;
  9. chdir "test" or die $!;
  10. my $num = 1;
  11. while ($num != 6000)
  12. {
  13. $num = $num + 1;
  14. open FILE, ">", "$num.txt" or die $!;
  15. }
  16. system("rm -rf test");
  17. my $duration = tv_interval($timedata) * 1000;
  18. print "$duration Milliseconds";
  19. print "\n";


any comments are mostly welcomed!
Want a new website for free:
http://indigo.kjots.com/
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC