beetlebug▾
/

ztk::game time

Gives the count of steps of the game.

ztk::game time

Description

The count includes the steps of ztk::game step. It goes on over ztk::game stop and a new ztk::game loop, and ztk::game loop -time N sets it. A game uses it as its clock, so a replay with the same input gives the same times. dict get [ztk::game info] seconds gives the time in seconds with the part of a step.

Returns

An integer.

Examples

% ztk::game loop -update {}
> ztk::game step 3
> ztk::game time
3

Errors

% ztk::game time now
wrong # args: should be "ztk::game time"
-errorcode TCL WRONGARGS

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.7