Water 5-Concurrent Programming-ThreadContract| Return type | wob | | Parameter key | Default value | Type | | a_time | req | type.<one_of number.integer duration datetime/> | | Water Contract<method thread.wait_until_time
a_time=req=<type.one_of number.integer duration datetime/>/> | |
See also: wait_until_condition, wait_until_done, datetime
wait_until_time causes the current thread to sleep until a certain amount of
time has passed. The thread will likely continue running very soon after that time
has passed but all that is guaranteed is that it will not continue
running until at leader that amount of time has passed.
You can have the thread wait for a certain number of milliseconds,
a water duration, or until a particular datetime occurs.
Example: wait for 100 milliseconds
thread.<wait_until_time a_time=100/>
Example: a_time can also be a duration
thread.<wait_until_time a_time=<duration seconds=0.25/>/>
 | null |
Example: waits until a_dt is the current time
<set a_dt=datetime.<current/>.<plus <duration seconds=0.25/>/>>
thread.<wait_until_time a_time=a_dt/> <!-- -->
</set> | null |
Here's a contrived example of using wait_until_time.
<echo "Hold on a sec while I grab a pencil."/>
thread.<wait_until_time a_time=200/>
<echo "OK, shoot. What was that phone number again?"/>
 | "OK, shoot. What was that phone number again?" |
© Copyright 2007 Clear Methods, Inc.