---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/api-reference

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# StopWatch (Next Experience) - Client

# StopWatch (Next Experience) - Client {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

The StopWatch API provides methods to measure durations in the Next Experience UI Framework.
{#StopWatchAPINX__table_lgv_pzl_rfc__entry__3}

| Name | Type | Description |
|-|-|-|
| started | [Date object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | Start date and time for the StopWatch. This value is set when calling the constructor [StopWatch(Object started)](https://servicenow-prod.fluidtopics.net/GDEuP6uP~IOMqBBJaUm0~w#StopWatchNX-StopWatch "Constructor to initialize a new StopWatch.") or the [restart()](https://servicenow-prod.fluidtopics.net/GDEuP6uP~IOMqBBJaUm0~w#StopWatchNX-restart "Resets the StopWatch start time as the current date and time.") method. |
[Tabelle : 1. Properties]

{#StopWatchAPINX__table_lgv_pzl_rfc}

## StopWatch (Next Experience) - StopWatch(Object started) {#ariaid-title2}

Constructor to initialize a new StopWatch.
{#StopWatchNX-StopWatch__table_lgv_pzl_rfc__entry__3}

| Name | Type | Description |
|-|-|-|
| started | [Date object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | Optional. Date and time to use as the start time for the StopWatch. Default: The current date and time. |
[Tabelle : 2. Parameters]

{#StopWatchNX-StopWatch__table_lgv_pzl_rfc}  
This example initializes a new StopWatch starting at the current date and time.

    var timer = new nowapi.StopWatch();

## StopWatch (Next Experience) - getTime() {#ariaid-title3}

Returns the elapsed time in milliseconds since the StopWatch started.
{#StopWatchNX-getTime__table_axh_pxl_rfc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 3. Parameters]

{#StopWatchNX-getTime__table_axh_pxl_rfc} {#StopWatchNX-getTime__table_bxh_pxl_rfc__entry__2}

| Type | Description |
|-|-|
| Number | Elapsed time since the StopWatch started. Unit: Milliseconds |
[Tabelle : 4. Returns]

{#StopWatchNX-getTime__table_bxh_pxl_rfc}  
This example returns the elapsed StopWatch time in milliseconds.

    var timer = new nowapi.StopWatch();
    console.log(timer.started);  //logs the StopWatch start date and time to the console
    var millis = timer.getTime();

## StopWatch (Next Experience) - restart() {#ariaid-title4}

Resets the StopWatch start time as the current date and time.
{#StopWatchNX-restart__table_wb5_lcm_rfc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 5. Parameters]

{#StopWatchNX-restart__table_wb5_lcm_rfc} {#StopWatchNX-restart__table_xb5_lcm_rfc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Tabelle : 6. Returns]

{#StopWatchNX-restart__table_xb5_lcm_rfc}  
This example returns the elapsed milliseconds since the timer started and restarted.

    var timer = new nowapi.StopWatch();
    console.log(timer.started);  //logs the StopWatch start date and time to the console
    timer.getTime();  //milliseconds since the timer started
    timer.restart();
    console.log(timer.started);  //logs the new StopWatch start date and time to the console
    timer.getTime();  //milliseconds since the timer restarted

## StopWatch (Next Experience) - toString() {#ariaid-title5}

Returns the elapsed time in ISO 8601 format (HH:mm:ss.sss) since the StopWatch started.
{#StopWatchNX-toString__table_mbh_rcm_rfc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 7. Parameters]

{#StopWatchNX-toString__table_mbh_rcm_rfc} {#StopWatchNX-toString__table_nbh_rcm_rfc__entry__2}

| Type | Description |
|-|-|
| String | Duration in ISO 8601 format containing hours, minutes, seconds, and milliseconds (HH:mm:ss.sss). |
[Tabelle : 8. Returns]

{#StopWatchNX-toString__table_nbh_rcm_rfc}  
This example returns the elapsed StopWatch time in the format HH:mm:ss.sss.

    var timer = new nowapi.StopWatch();
    var duration = timer.toString();


