File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes block timer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "block timer" Watch "block timer" New topic
Author

block timer

chuck johnson
Greenhorn

Joined: Dec 10, 2002
Posts: 2
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

Joined: Apr 18, 2002
Posts: 238
try this:


CNSS/NSA Infosec Professional,<br />Software Engineer
chuck johnson
Greenhorn

Joined: Dec 10, 2002
Posts: 2
thanks a lot. just off-hand, do you happen to know what kind a units that is in?
Norm Miller
Ranch Hand

Joined: May 21, 2002
Posts: 56
milliseconds
Sam Smoot
Ranch Hand

Joined: Apr 18, 2002
Posts: 238
Cast as a long...
Units are milliseconds... (1,000 = 1 second)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: block timer