• Post Reply Bookmark Topic Watch Topic
  • New Topic

Method testing (timing in milliseconds)

 
Ambrose Duggan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey

Need help with a program that test's the timing of a method or methods and writes the timing information to a seperate file

Any Help Greatly appreciated

Ambrose (Ireland)
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is how to test the timing of a method
----------------
long begin_time=System.currentTimeMillis();

//call the method

long end_time=System.currentTimeMillis();
System.out.println("The operation took "+(end_time-begin_time)+" milliseconds.");
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!