Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Computer User Timer

by cbro (Pilgrim)
on Jun 12, 2003 at 16:16 UTC ( #265402=note: print w/ replies, xml ) Need Help??


in reply to Computer User Timer

I suggest Time::HiRes and the setitimer/getitimer functions. For docs go here.
You could set the timer using setitimer. Then to display a a timer to the user, use getitimer and keep updating a formatted line via some method like 'formline' (which I use personally for displaying progress bars). Eventually, setitimer is going to send a SIG_ALARM, which you can catch in a subroutine that implements whichever method of 'stopping' the user from continuing to use the PC that you decide to use (e.g. I don't know what exactly to do to prevent access to the PC when the timer expires).

HTH,
Chris


Comment on Re: Computer User Timer

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2014-08-27 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (248 votes), past polls