Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

block timer

 
chuck johnson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to basically wrap some sort of timer around a block of code. i need to be able to print out how long it took to execute that particular block of code. i've looked through the api and the books i have, but i cant find anything helpful. any ideas?
 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this:
 
chuck johnson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot. just off-hand, do you happen to know what kind a units that is in?
 
Norm Miller
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
milliseconds
 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cast as a long...
Units are milliseconds... (1,000 = 1 second)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic