pxt-calliope/docs/reference/input/running-time.md

30 lines
537 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# Running Time
Get the number of milliseconds elapsed since the script began. 1,000 milliseconds = 1 second.
```sig
input.runningTime();
```
### Returns
2016-04-13 17:27:45 +02:00
* [Number](/reference/types/number)
2016-03-26 00:47:20 +01:00
### Example: elapsed time
This code gets the elapsed time since the start of the program execution and displays it on the screen.
```blocks
let now = input.runningTime()
basic.showNumber(now)
```
### Lessons
2016-04-13 17:27:45 +02:00
[speed button](/lessons/speed-button)
2016-03-26 00:47:20 +01:00
### See also
2016-04-13 17:27:45 +02:00
[show number](/reference/basic/show-number), [pause](/reference/basic/pause)
2016-03-26 00:47:20 +01:00