# SetSleepPolicy

int SetSleepPolicy (int sleepPolicy);

## Purpose

When the User Interface Library checks for an event from the operating system, it can put your program in the background, to sleep, for a specified period of time. This action gives other applications more processor time, but your program might run more slowly.

Use SetSleepPolicy to set the amount your program sleeps when LabWindows/CVI checks for events. The setting that is optimal for your program depends on the operating system you are using and the other applications you are running. If you think an adjustment is necessary, try the different settings and observe the resulting behavior.

LabWindows/CVI maintains a separate sleep policy for each thread of your program.

## Parameters

Input
Name | Type | Description
sleepPolicy | integer | Degree to which your program periodically sleeps each time the User Interface Library checks for events from the operating system. The following lists the valid settings.
Name | Code | Description
VAL_SLEEP_NONE | 1 | Never be put to sleep.
VAL_SLEEP_SOME | 2 | Be put to sleep for a short period.
VAL_SLEEP_MORE | 3 | Be put to sleep for a longer period.
The default policy is VAL_SLEEP_MORE.

## Return Value

Name | Type | Description
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
Code | Error Message String
xx | Success