---
title: "Process control"
canonical: "https://docs.cuesystem.com/space/CVCHELP/512327806/Process%20control"
format: markdown
---
> Macro (toc)

---

# Wait

This function waits a specified time. All commands and statements following the Wait within the function/process will be executed after the specified timeout. 

#### Syntax 

```visualbasic
Function Wait(timeout As Time)
```

#### Parameters 

timeout 

<u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> It is the timeout. 

# WaitForLocalTime

This function suspends the current process until a parameter localtime of the unit will be reached. 

The parameter localtime must be entered as absolute time (e.g. #03/14/2009 12:35:05#), see the <u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> type. Otherwise, the function exits immediately and returns false. 

#### Syntax 

```visualbasic
Function WaitForLocalTime(localtime As Time)
```

#### Parameters 

localtime 

<u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> It is the time to be reached. 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True on success or False if an error occurs. 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[30](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#30)</u>, <u>[31](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#31)</u>. 

# WaitForUTCTime

This function suspends the current process until a parameter utctime of the unit will be reached. 

The parameter utctime must be entered as absolute time (e.g. #03/14/2009 12:35:05#), see the <u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> type. Otherwise, the function exits immediately and returns false. 

#### Syntax 

```visualbasic
Function WaitForUTCTime(utctime As Time)
```

#### Parameters 

utctime 

<u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> It is the time to be reached. 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True on success or False if an error occurs. 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: <u>[30](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#30)</u>, <u>[31](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#31)</u>.