LogoLogo
2.3.1
2.3.1
  • Introduction
  • Getting started
    • Installation
      • On-premises
      • Azure Market Place
      • AWS Market Place
    • Concepts
      • Datadate
      • Datasets
      • Program directory
      • Home directory
      • RDFs
      • Accounts
      • Services
    • Configuration
      • Data Sources
        • Extractors
        • Transformers
      • Catalogue
        • Adjustments
        • Rates
        • Services
      • Administration
        • Configuration
        • Users Groups
        • Workflows
    • Tutorials
      • Amazon AWS CUR
      • Azure EA
      • Azure CSP
      • Azure Stack
    • Releases
      • Upgrading to version 2
      • Archive
  • Diving deeper
    • Extract
      • Templates
      • Script basics
      • Parslets
      • Language
        • aws_sign_string
        • basename
        • buffer
        • csv
        • clear
        • discard
        • encode
        • encrypt
        • escape
        • exit_loop
        • foreach
        • get_last_day_of
        • gosub
        • gunzip
        • hash
        • http
        • if
        • json
        • loglevel
        • loop
        • match
        • pause
        • print
        • return
        • save
        • set
        • subroutine
        • terminate
        • unzip
        • uri
        • var
    • Transform
      • Language
        • aggregate
        • append
        • calculate
        • capitalise
        • convert
        • copy
        • correlate
        • create
        • default
        • delete
        • export
        • finish
        • if
        • import
        • include
        • lowercase
        • normalise
        • option
        • rename
        • replace
        • round
        • service
        • services
        • set
        • split
        • terminate
        • timecolumns
        • timerender
        • timestamp
        • update_service
        • uppercase
        • var
        • where
    • Report
      • Defining reports
      • Accounts
      • Services
      • Summary
    • Integrate
      • API docs
      • GUI automation
        • Examples
      • Single Sign On
        • Azure-AD
        • Auth0
Powered by GitBook
On this page
  • Syntax
  • Details
  • Example

Was this helpful?

Export as PDF
  1. Diving deeper
  2. Extract
  3. Language

pause

PreviousmatchNextprint

Last updated 6 years ago

Was this helpful?

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 .

var first = ${ARG_1}
var last = ${ARG_2}
var last += 1
var x = ${first}

# Retrieve a number of files from http://server.local/?.dat where ? is a number
# Wait for 1 second between each file
loop slurp {
    var url = http://server.local/datafiles/${x}.dat
    set http_savefile data/${x}.png
    print Getting datafile ${x}
    http GET ${url}
    if (${HTTP_STATUS_CODE} == 200) {
        print 200 OK
    }
    if (${HTTP_STATUS_CODE} == 404) {
        print Data file ${x} missing on server
    }
    var x += 1
    if (${x} == ${last}) {
        exit_loop
    }
        pause 1000   # Wait for 1 second
}
print ${x} files were downloaded
terminate
Extract introduction