Time.Sleep
----------

Delays execution for the given number of milliseconds.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Utility](component_Utility.md) | [4.1](newinversion41.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Time.Sleep"; Duration ) 

**MBS**( **"Time.Sleep";** /\* Delays execution for the given number of milliseconds. \*/  
**$Duration**) /\* Number of milliseconds to wait.e.g. 10 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Duration | Number of milliseconds to wait. | 10 |

### Result

Returns OK or error.

### Description

Delays execution for the given number of milliseconds.  
You can use this to delay something on purpose. The while FileMaker Pro app is locked for the given time.  
Pass 1000 for a one second delay.  
This pauses execution of evaluation or a script.  
  
To avoid you block yourself endlessly, we limit the range to 1 to 60000 microseconds = one minute maximum.  
### Examples

Pause 5 milliseconds:

 Let(\[  
 t1 = Get(CurrentTimeUTCMilliseconds);  
 r = MBS ( "Time.Sleep"; 5 );  
 t2 = Get(CurrentTimeUTCMilliseconds)  
\]; t1 &amp; ¶ &amp; t2)  
<small>  
Example result:   
63750557007194  
63750557007200</small>### See also

- [SystemInfo.CPULoad](SystemInfoCPULoad.md)
- [Time.Wait](TimeWait.md)

### Release notes

- **Version 11.1**
    - Fixed rounding error with [Time.Sleep](https://www.mbsplugins.eu/TimeSleep.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 11.1pr9](https://www.mbsplugins.de/archive/2021-03-06/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Comparing Base Elements Plugin to MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-10-24/Comparing_Base_Elements_Plugin/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 13th April 2021

  
[Time.Parse](TimeParse.md) - [Time.TimeStampToUTC](TimeTimeStampToUTC.md)

[HTML Version](TimeSleep.shtml)