Jump to content
Sign in to follow this  
pezo89

random timer

Recommended Posts

pezo89

Is there a way to have a random timer on a mouseclick, so it isent a set sleep time only?..

Share this post


Link to post
Share on other sites
Skruge

Take a look at the Random() Function.


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites
DrKovra

This set of statements ... Sleeps the program for a period of time in seconds between $minSEC and $maxSEC .... ^_^

Sleep(Random($minSEC,$maxSEC,1))

[s][font="Impact"]░▒▓▓►DrKovra◄▓▓▒░[/font][/s]The only thing I [sup]know [/sup]is that I don't know [sub]nothing[/sub]--------------- __________------------------------------ __________---------------

Share this post


Link to post
Share on other sites
Mike23

This set of statements ... Sleeps the program for a period of time in seconds between $minSEC and $maxSEC .... ^_^

Sleep(Random($minSEC,$maxSEC,1))

the SEC are miliSEC so 1000 = 1 second

example

Sleep(random(750,2000))

wil generate a random sleep between 0.75 Seconds and 2 Seconds.

Edited by Mike23

Share this post


Link to post
Share on other sites
DrKovra

Don't forget the "1" in ... Random($minSEC,$maxSEC,1))

It tells the random function to return an integer value !


[s][font="Impact"]░▒▓▓►DrKovra◄▓▓▒░[/font][/s]The only thing I [sup]know [/sup]is that I don't know [sub]nothing[/sub]--------------- __________------------------------------ __________---------------

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×