Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

timing response from database

by perlknight (Pilgrim)
on Feb 20, 2007 at 03:16 UTC ( [id://601009]=perlquestion: print w/replies, xml ) Need Help??

perlknight has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks, I have a script which monitor if the database is available or not. It does this by logging in and query the the dual table for sysdate. It is currently working, but I want to extract how much time has elapse since I started the the call to the database until I get the result back. I was thinking of getting the timestamp in epoch before making the call to the database and getting the timestamp again after the result is returned. Take the different and covert it back from epoc to regular time. Does anyone have any idea? Thanks.

Replies are listed 'Best First'.
Re: timing response from database
by GrandFather (Saint) on Feb 20, 2007 at 03:24 UTC

    Time::HiRes may be what you are looking for.


    DWIM is Perl's answer to Gödel
Re: timing response from database
by chrism01 (Friar) on Feb 20, 2007 at 05:59 UTC
    You might also want to look at SIGALRM, so you can limit how long it takes and check whether it timed out or returned a different error, if any.
Re: timing response from database
by adrianh (Chancellor) on Feb 20, 2007 at 13:13 UTC
Re: timing response from database
by jdtoronto (Prior) on Feb 20, 2007 at 14:50 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found