# monitor { #vscodenb.monitor }

```python
vscodenb.monitor(func=None, **monitor_kwargs)
```

Decorator for CPU monitoring.

By default, the function name is used as the label. You can override
this by passing label=None or label="custom label".

## Parameters {.doc-section .doc-section-parameters}

<code>[**func**]{.parameter-name} [:]{.parameter-annotation-sep} [[callable](`callable`)]{.parameter-annotation} [ = ]{.parameter-default-sep} [None]{.parameter-default}</code>

:   Function to monitor

<code>[****monitor_kwargs**]{.parameter-name} [:]{.parameter-annotation-sep} []{.parameter-annotation} [ = ]{.parameter-default-sep} [{}]{.parameter-default}</code>

:   Arguments passed to CPUMonitor

## Examples {.doc-section .doc-section-examples}

```python
>>> @monitor
>>> def my_function():
...     # computation
...     pass  # Label will be "my_function"
```

```python
>>> @monitor(width=100, update_interval=1.0)
>>> def my_function():
...     # computation
...     pass  # Label will be "my_function"
```

```python
>>> @monitor(label=None)
>>> def my_function():
...     # computation
...     pass  # No label
```