Clock
✖
Clock
Clock[]
represents a clock variable whose value cycles continuously from 0 to 1 once per second when it appears inside a dynamically updated object such as a Dynamic.
Clock[t]
cycles from 0 to t every t seconds.
Clock[vmax,t]
cycles from 0 to vmax every t seconds.
Clock[{vmin,vmax},t]
cycles through the range vmin to vmax every t seconds.
Clock[{vmin,vmax}]
cycles through the range vmin to vmax over the course of vmax-vmin seconds.
Clock[{vmin,vmax,dv}]
cycles from vmin to vmax in steps of dv, spending dv seconds at each value.
Clock[{vmin,vmax,dv},t]
cycles from vmin to vmax in steps dv every t seconds.
Clock[vals,t,n]
goes through the cycle only n times, then always yields only the maximum value.
Details

- The base for all times used by Clock is the creation time of the cell in which Clock appears.
- Clock[Infinity] gives a value that ranges from
to
at a rate of one unit per second.
- Clock[{vmin,Infinity}] gives a value that ranges from vmin to
at a rate of one unit per second.
- Clock[{vmin,Infinity,dv}] ranges from vmin to
in steps of dv, spending dv seconds at each value.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Create a clock value that cycles continuously from 0 to 1 once per second:

https://wolfram.com/xid/0mq8go-lilxkz

Use Clock to trigger updates for some time interval:

https://wolfram.com/xid/0mq8go-cti6tq

Scope (7)Survey of the scope of standard use cases
A clock that counts from 0 to 5 in 5 seconds:

https://wolfram.com/xid/0mq8go-1xgayt

A clock that counts from 0 to 5 in 1 second:

https://wolfram.com/xid/0mq8go-7x4vg8

A clock that counts from 5 to 7 in 2 seconds:

https://wolfram.com/xid/0mq8go-pp1qqv

A clock that counts from 50 to 100 in 1 second:

https://wolfram.com/xid/0mq8go-k78ztp

A clock that counts from 0 to 5 in steps of 1:

https://wolfram.com/xid/0mq8go-4t3ixr

A clock that counts from 1 to 10 in steps of 1 in 2 seconds:

https://wolfram.com/xid/0mq8go-esqi4k

A clock that counts from 0 to 10 in 5 seconds, ending after one time:

https://wolfram.com/xid/0mq8go-38t16j

Properties & Relations (1)Properties of the function, and connections to other functions
Clock can be fed as an argument to any function where the numeric value makes sense:

https://wolfram.com/xid/0mq8go-eqyo54

Wolfram Research (2007), Clock, Wolfram Language function, https://reference.wolfram.com/language/ref/Clock.html.
Text
Wolfram Research (2007), Clock, Wolfram Language function, https://reference.wolfram.com/language/ref/Clock.html.
Wolfram Research (2007), Clock, Wolfram Language function, https://reference.wolfram.com/language/ref/Clock.html.
CMS
Wolfram Language. 2007. "Clock." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Clock.html.
Wolfram Language. 2007. "Clock." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Clock.html.
APA
Wolfram Language. (2007). Clock. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Clock.html
Wolfram Language. (2007). Clock. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Clock.html
BibTeX
@misc{reference.wolfram_2025_clock, author="Wolfram Research", title="{Clock}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Clock.html}", note=[Accessed: 25-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_clock, organization={Wolfram Research}, title={Clock}, year={2007}, url={https://reference.wolfram.com/language/ref/Clock.html}, note=[Accessed: 25-March-2025
]}