; ; @ANO_SCRIPT_NAME time_stretch ; @ANO_SCRIPT_VERSION 0.0.1 ; @ANO_SCRIPT_DESCRIPTION Simple example to stretch internal clock ; ; @ANO_FLAGS_USE_PROTOS [ ] ; @ANO_FLAGS_VAR_NAME_SUBS [ ] ; @ANO_FLAGS_VAR_WARN_UNUSED [ ] ; ; Copyright (c) 2016-2026, Jani Salonen ; All rights reserved. ; ; Example to modify internal clock to make it run ten times faster. Setting ; internal clock tick speed affects to some engine's internal functionality, ; like some timers runs faster or slower. When tick is set to one, engine's ; clock goes hand in hand with system clock. Settings clock ticks does not ; modify or set operating system clock in any way, just engine's internal tick ; counting mechanism. ; main [exit: 0] { ; Get system time in secs since epoch and set clock to that. ; _time = time clock_set (_time) _n = time_strfmt (\ time: _time, \ format: "%Y-%m-%dT%H:%M:%S") print "This moment is: " . _n . "\n\n" ; Get current clock tick count. ; _tick = clock_get_ticks ; Set clock multiplier to one thousand to make it run thousand times ; faster. ; _old_mul = clock_set_multiplier (1000) print "Current clock multiplier is: " . _old_mul . "\n" ; Get current multiplier. ; _new_mul = clock_get_multiplier print "New clock multiplier is: " . _new_mul . "\n\n" ; Wait for a while to tick count to increase. ; sleep (2, 0) ; Get clock tick count again. ; _tick = clock_get_ticks _n = time_strfmt (\ time: _tick, \ format: "%Y-%m-%dT%H:%M:%S") print "Now the moment is: " . _n . ", which is ahead system time.\n" }