Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Live operations-per-second counter

by blueberryCoffee (Scribe)
on Mar 21, 2005 at 00:15 UTC ( #441085=note: print w/replies, xml ) Need Help??


in reply to Live operations-per-second counter

just count and average as you go.
$setTimeStart = time; $setCount = 0; while (<IN>) { # process line here $setCount++; # show line speed for every 1000 lines so prints don't # slow you down so much if($setCount < 999) { $setCount = 0; $setTime = time - $setTimeStart; print "processing 1000 lines at " . $setTime/1000 . " per line\n +"; $setTimeStart = time; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://441085]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2023-02-07 18:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (40 votes). Check out past polls.

    Notices?