Platform
Resources
Pricing
Sign in
Get started
Kasi Viswanath
I love building things that make people's life easier
Workspace
Fork
Public
By
Kasi Viswanath
Edited
Oct 26, 2023
Insert cell
Insert cell
async
function
counter
(
)
{
//send notification for every 10, 20seconds
let
a
=
performance
.
now
(
)
;
await
new
Promise
(
(
resolve
)
=>
setTimeout
(
resolve
,
1000
)
)
;
return
performance
.
now
(
)
-
a
;
}
Insert cell
counter
(
)
Insert cell
async
function
*
counter_generator
(
)
{
let
counter
=
1
;
while
(
true
)
{
let
a
=
performance
.
now
(
)
;
await
new
Promise
(
(
resolve
)
=>
setTimeout
(
resolve
,
1000
)
)
;
counter
+=
1
;
yield
counter
;
}
}
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
counter
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
counter_generator
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML