Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need milliseconds

Status
Not open for further replies.

jimmyJIMMYyaya

Programmer
Sep 30, 2001
13
CA
hey all

im in need of obtaining milliseconds. is there perl function for this?

i have a search script that has three subroutines.
1) initialize
2) process
3) terminate

in initialize i want to get the current milliseconds of the current time

in the terminiate i want to get the current milliseconds of the current time

then i want to find the difference so i can let the user now how long the search took.

i need milliseconds because it never takes more than a second for a return.

thanks for all your help in advance :)
 
Jimmy, hi.

There's a module on CPAN called Benchmark that may be of use to you.

I sympathise though, it's always a problem trying to work out how efficient a particular bit of code is. I usually end up running it a great many times to try and average it out.

Benchmark is particularly good at this kind of thing, it's well worth the effort to learn how to use it. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top