Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/stopwatch: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Remove broken links to missing pages
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
 
Line 1: Line 1:
{{exclusive|Java}}
{{MC/Exclusive|Java}}
{{stub}}
{{MC/Stub}}
{{Infobox command
{{Infobox command
| name = stopwatch
| name = stopwatch
Line 6: Line 6:
}}
}}


Allows manipulation of stopwatches to keep track of ''real'' time — the time measured is not affected by the game's tick rate (i.e. pausing, {{cmd|tick}}, or even server lag).
Allows manipulation of stopwatches to keep track of ''real'' time — the time measured is not affected by the game's tick rate (i.e. pausing, {{MC/Cmd|tick}}, or even server lag).


The time is calculated with millisecond precision. Therefore:
The time is calculated with millisecond precision. Therefore:
Line 16: Line 16:
* '''''Java Edition'''''
* '''''Java Edition'''''
: <code>stopwatch create <id></code> - Creates a stopwatch, which immediately begins running
: <code>stopwatch create <id></code> - Creates a stopwatch, which immediately begins running
: <code>stopwatch query <id> <scale></code> - Gets the value of the stopwatch, the amount of time since it was created/restarted. <code>scale</code> does not affect the displayed value in chat, but does affect the value returned e.g. for {{cmd|execute store result...}}. If the return value would exceed 32-bit signed integer limits (<-2147483648 or >2147483647), it is clamped.
: <code>stopwatch query <id> <scale></code> - Gets the value of the stopwatch, the amount of time since it was created/restarted. <code>scale</code> does not affect the displayed value in chat, but does affect the value returned e.g. for {{MC/Cmd|execute store result...}}. If the return value would exceed 32-bit signed integer limits (<-2147483648 or >2147483647), it is clamped.
: <code>stopwatch restart <id></code> - Restarts a stopwatch
: <code>stopwatch restart <id></code> - Restarts a stopwatch
: <code>stopwatch remove <id></code> - Removes a stopwatch
: <code>stopwatch remove <id></code> - Removes a stopwatch
Line 22: Line 22:
== History ==
== History ==
{{HistoryTable
{{HistoryTable
|{{HistoryLine|java}}
|{{MC/HistoryLine|java}}
|{{HistoryLine||1.21.11|dev=25w41a|Added {{cmd|stopwatch|link=none}}.}}
|{{HistoryLine||1.21.11|dev=25w41a|Added {{MC/Cmd|stopwatch|link=none}}.}}
|{{HistoryLine|||dev=25w42a|Switched the order of the id argument.
|{{HistoryLine|||dev=25w42a|Switched the order of the id argument.
|{{cd|query}} now returns the queried value.
|{{MC/Cd|query}} now returns the queried value.
|Added the {{cd|scale}} argument to {{cd|query}}.}}
|Added the {{MC/Cd|scale}} argument to {{MC/Cd|query}}.}}
}}
}}


== Navigation ==
== Navigation ==
{{Navbox commands}}
{{MC/Navbox commands}}


de:Befehl/stopwatch
de:Befehl/stopwatch

Latest revision as of 20:14, 9 April 2026

Script error: No such module "Exclusive". Template:Message box Template:Infobox command

Allows manipulation of stopwatches to keep track of real time — the time measured is not affected by the game's tick rate (i.e. pausing,

  1. REDIRECT Template:Command

Template:Redr, or even server lag).

The time is calculated with millisecond precision. Therefore:

  • When displayed, it is presented in seconds with 3 decimal places (e.g. 43.961s).
  • While any integer value can be used as the scale argument, a scale with absolute value >1000 is not useful to extract additional precision in the integer return value.

Syntax

  • Java Edition
stopwatch create <id> - Creates a stopwatch, which immediately begins running
stopwatch query <id> <scale> - Gets the value of the stopwatch, the amount of time since it was created/restarted. scale does not affect the displayed value in chat, but does affect the value returned e.g. for
  1. REDIRECT Template:Command

Template:Redr. If the return value would exceed 32-bit signed integer limits (<-2147483648 or >2147483647), it is clamped.

stopwatch restart <id> - Restarts a stopwatch
stopwatch remove <id> - Removes a stopwatch

History

Template:HistoryTable

Navigation

All editions
Removed
Template:El only
Debug
Removed
Template:Els only
Template:El only
Removed
Template:El only
Removed
Template:Els only
Removed
Joke
Related

de:Befehl/stopwatch ja:コマンド/stopwatch pt:Comandos/stopwatch zh:命令/stopwatch