## schedule()


Schedule a task for later execution.


Usage


``` python
schedule(
    task,
    delay=0.0,
)
```


Registers the given task identifier to be executed after the specified delay. Returns whether the scheduling was successful.

> **Note: Note**
>
> Tasks are identified by their string name. Scheduling the same task twice will return False the second time.

## Examples

``` python
>>> schedule("cleanup")
```

True

``` python
>>> schedule("backup", delay=60.0)
```

True

``` python
>>> schedule("cleanup")
```

False


## Parameters


`task: str`  
The task identifier string to schedule.

`delay: float = ``0.0`  
Number of seconds to wait before executing. Must be non-negative. Defaults to `0.0`.


## Returns


`bool`  
True if the task was successfully scheduled, False if the task is already scheduled.


## Raises


`ValueError`  
If `delay` is negative.

`TypeError`  
If `task` is not a string.
