-- Note that loading a save stops the evaluation. If it should work always, call it during initialization of the script (i.e. not in a handler)
-- @function [parent=#time] runRepeatedly
-- @param #function fn the function that should be called
-- @param #number period interval
-- @param #table options additional options `initialDelay` and `type`.
-- `initialDelay` - delay before the first call. If missed then the delay is a random number in range [0, N]. Randomization is used for performance reasons -- to prevent all scripts from doing time consuming operations at the same time.
-- `type` - either `time.SimulationTime` (by default, timer uses simulation time) or `time.GameTime` (timer uses game time).
-- @return #function a function without arguments that can be used to stop the periodical evaluation.
-- @usage
-- local stopFn = time.runRepeatedly(function() print('Test') end,
-- 5 * time.second) -- print 'Test' every 5 seconds
-- stopFn() -- stop printing 'Test'
-- time.runRepeatedly( -- print 'Test' every 5 minutes with initial 30 second delay