Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Automation Scripting User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

sleep() Function (SLAX and XSLT)

date_range 13-Jan-21

Namespaces

content_copy zoom_out_map
http://xml.juniper.net/junos/commit-scripts/1.0
http://xml.libslax.org/slax

SLAX Syntax

content_copy zoom_out_map
expr prefix:sleep(seconds, <milliseconds>);

XSLT Syntax

content_copy zoom_out_map
<xsl:value-of select="prefix:sleep(seconds, <milliseconds>)"/>

Description

Cause the script to pause for a specified number of seconds and (optionally) milliseconds. You can use this function to help determine how a device component works over time. To do this, write a script that issues a command, calls the jcs:sleep() function, and then reissues the same command.

The prefix associated with the namespace URI should be defined in the prefix-to-namespace mapping in the style sheet.

Parameters

milliseconds

(Optional) Number of milliseconds the script should sleep.

seconds

Number of seconds the script should sleep.

Usage Examples

In the following example, jcs:sleep(1) causes the script to sleep for 1 second, and jcs:sleep(0, 10) causes the script to sleep for 10 milliseconds:

SLAX syntax:

content_copy zoom_out_map
expr jcs:sleep(1);
expr jcs:sleep(0, 10);

XSLT syntax:

content_copy zoom_out_map
<xsl:value-of select="jcs:sleep(1)"/>
<xsl:value-of select="jcs:sleep(0, 10)"/>

Release Information

Function introduced in Junos OS Release 7.6.

Support for the slax namespace http://xml.libslax.org/slax added in Junos OS Release 12.2.

footer-navigation