Random Sleep time
Posted 19 April 2011 - 06:06 PM
I typically have code pieces:
I would like to be able instead of having a fixed time have one of two solutions
1. A random time between a MAX and MIN number; or,
2. Set up a choice of 5 times and have it randomly pick each time it executes.
This script is in a loop which runs unattended and interacts with various website databases that I own.
Either solutions would work for me.
Posted 19 April 2011 - 06:22 PM
The own fart smells best! ✌
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
Posted 19 April 2011 - 06:25 PM
- 1. Use Random as the argument to Sleep:
This will sleep for a random time between 1 and 10 seconds.
- 2. Use an array to store the times and then use Random to choose which element to use:
You get sleeps of 1, 3, 5, 7 or 9 seconds.
Toast - Small GUIs which pop out of the Systray   Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI   NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure   Notify - Small notifications on the edge of the display
Date_Time_Convert- Easily convert date/time formats, including the language   GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
Posted 23 April 2011 - 09:33 PM
Posted 24 April 2011 - 02:41 AM
Global $aTimes = [1, 3, 5, 7, 9]
Wow learn something new everyday! Didn't know you could assign Arrays like that. I would have done it the hard way:
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users