Search…
pause
The pause statement is used to suspend execution of a USE script for a specified time.

Syntax

pausedelaytime

Details

The delaytime parameter is the number of milliseconds to wait before continuing. A value of 0 is allowed, in which case no delay will occur.
The pause statement may be useful in cases where an external data source imposes some form of rate limiting on the number of queries that can be serviced in a given time-frame, or to slow down execution at critical points when debugging a long or complex script.

Example

This example makes use of script parameters which are provided when USE is executed. For more information on script parameters please refer to the Extract introduction.
1
var first = ${ARG_1}
2
var last = ${ARG_2}
3
var last += 1
4
var x = ${first}
5
6
# Retrieve a number of files from http://server.local/?.dat where ? is a number
7
# Wait for 1 second between each file
8
loop slurp {
9
var url = http://server.local/datafiles/${x}.dat
10
set http_savefile data/${x}.png
11
print Getting datafile ${x}
12
http GET ${url}
13
if (${HTTP_STATUS_CODE} == 200) {
14
print 200 OK
15
}
16
if (${HTTP_STATUS_CODE} == 404) {
17
print Data file ${x} missing on server
18
}
19
var x += 1
20
if (${x} == ${last}) {
21
exit_loop
22
}
23
pause 1000 # Wait for 1 second
24
}
25
print ${x} files were downloaded
26
terminate
Copied!
Last modified 2yr ago
Export as PDF
Copy link