Skip to content

Commit

Permalink
Basic graduation of k6/timers docs (#1529)
Browse files Browse the repository at this point in the history

Co-authored-by: Heitor Tashiro Sergent <heitortsergent@gmail.com>
  • Loading branch information
mstoykov and heitortsergent committed Mar 22, 2024
1 parent 1d3c4b0 commit 39317ea
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/sources/next/javascript-api/k6-experimental/timers.md
Expand Up @@ -6,7 +6,7 @@ weight: 03

# timers

{{< docs/shared source="k6" lookup="experimental-module.md" version="<K6_VERSION>" >}}
{{< docs/shared source="k6" lookup="experimental-timers-module.md" version="<K6_VERSION>" >}}

This modules implements the commonly found in browsers:

Expand Down
16 changes: 16 additions & 0 deletions docs/sources/next/javascript-api/k6-timers/_index.md
@@ -0,0 +1,16 @@
---
title: "k6/timers"
description: "k6 timers API"
weight: 13
---

# k6/timers

Implement timers to work with k6's event loop. They mimic the functionality found in browsers and other JavaScript runtimes.

| Function | Description |
| :------------------------------------------ | :--------------------------------------------------------------------------------------------- |
| [setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) | Sets a function to be run after a given timeout. |
| [clearTimeout](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) | Clears a previously set timeout with `setTimeout`. |
| [setInterval](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) | Sets a function to be run on a given interval. |
| [clearInterval](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) | Clears a previously set interval with `setInterval`. |
11 changes: 11 additions & 0 deletions docs/sources/next/shared/experimental-timers-module.md
@@ -0,0 +1,11 @@
---
title: Experimental timers module admonition
---

{{% admonition type="caution" %}}

Starting on k6 `v0.50`, the experimental module `k6/experimental/timers` has been graduated, and its functionality is now available in the [`k6/net/timers` module](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-timers/). The `k6/experimental/timers` is deprecated and will be removed in `v0.52.0`.

To migrate your scripts, replace all `k6/experimental/timers` imports with `k6/net/timers`.

{{% /admonition %}}

0 comments on commit 39317ea

Please sign in to comment.