# useElapsedTime

*Category:* Utilities
*Section:* Lifecycle & execution hooks
*Source:* https://uikit.developers.rio.cloud/#/utilities/useElapsedTime
*Captured:* 2026-04-27T14:59:30.727Z

## useElapsedTime

### Example: Example 1

Get elapsed time Elapsed time sind mount: 0 ms

#### React (tsx)

```tsx
import { useState } from 'react';

import useElapsedTime from '@rio-cloud/rio-uikit/useElapsedTime';
import Button from '@rio-cloud/rio-uikit/Button';

export default () => {
    const [timeValue, setTimeValue] = useState(0);

    const getElapsedTime = useElapsedTime();

    const handleClick = () => {
        const elapsedTime = getElapsedTime();
        setTimeValue(elapsedTime);
    };

    return (
        <div>
            <Button onClick={handleClick}>Get elapsed time</Button>
            <p>Elapsed time sind mount: {timeValue} ms</p>
        </div>
    );
};
```

#### HTML (html)

```html
<div>
    <button type="button" class="btn btn-default btn-component" tabindex="0">Get elapsed time</button>
    <p>Elapsed time sind mount: 0 ms</p>
</div>
```

#### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| startTime | Function | Date.now() | The start time in milliseconds from which to measure the elapsed time. |