---
version: "2026.1.0"
language: "en"
---
# Stopwatch

The **Stopwatch** building block measures elapsed time between different parts of an automation case. It can be used, for example, to measure how long an application takes to open or how long a business transaction takes to complete. In combination with a [Compare](https://docs.leapwork.com/leapwork-flow/latest/building-blocks/logic/compare.md) block, it can also be used to assert that something completes within a specific time-frame.

Another example can be found in the [Use the clipboard to insert text lesson](https://www.leapwork.com/services/learning-center/using-clipboard-to-insert-text), where the time it takes to insert text using different methods is measured using the Stopwatch block.

Fully expanded, the **Stopwatch** block shows the following properties:  
![image-20260207-095513.png](https://docs.leapwork.com/__attachments/a_1f898b2810d2e8416edb5d6f1493396858739cd2142a8a785fd046e98456e743/image-20260207-095513.png?cb=3c909dc6344479c172b25ceb6248afe4)

**Note:** The screenshot on this page uses the **Elegance Design** , introduced in **2025.3**. If you are using an earlier version, your layout may look different.

## Quick-start

1. Drag **Stopwatch** onto the canvas.

2. Connect the block in the flow. Trigger the block where you want to start (or reset) the timer, and use **Elapsed time** later in the flow.

3. Run the flow when it's ready.

## Building block parameters

Parameters  
* **Block header** : The green input connector triggers the block to start executing and thereby starts or resets the stopwatch. The green output connector triggers once the stopwatch has been started (or reset). You can rename the block title ("Stopwatch") by double-clicking it and typing a new title.

* **Elapsed time** : Contains a timespan representing the total elapsed time since the stopwatch input was last triggered (for example `00:01:05:0004123`). You can expand it to access the individual sub-properties **Hour** , **Minute** , **Second** , and **Millisecond**.

## Flow Example

The following is an example of an endlessly looping test case that resets a stopwatch every 65 seconds, outputting the total elapsed time as well as the current elapsed seconds and milliseconds.  
![image-20260207-100149.png](https://docs.leapwork.com/__attachments/a_f12a1c9b39d72d41a28eb24e544ad90e5c4d9167648d4a735e94f33ea55948ba/image-20260207-100149.png?cb=2ab800de7f91e813bb0546e5292e9128)

In the example, for each iteration, **Field 1** will contain a timespan value like `00:01:05:0004123`, while **Field 2** will contain `5` and **Field 3** will contain something like `0,4123`.

When used as a number (for example in a [Calculate](https://docs.leapwork.com/leapwork-flow/latest/building-blocks/logic/calculate.md) block), timespans are converted to the total number of seconds and milliseconds. In this example, that would be `65,0004123`.

## Resources

|                                                **Topic**                                                |                                                  **Description**                                                  |
|---------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| [Flows FAQ](https://docs.leapwork.com/faq/latest/leapwork-flow-faq/flows-faq.md)                                                 | Common questions about creating, running, and managing flows in Leapwork.                                         |
| [Flows Troubleshooting](https://docs.leapwork.com/troubleshooting/latest/leapwork-flow-troubleshooting/flows-troubleshooting.md) | Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork. |