yield - wait for next invocation of main engine loop (e.g., next frame in a game)
That is the definition of yield from the MiniScript manual, and from what I know of Unity, it's essentially a "stop executing here until the next frame", which matches your description, so I think I'm good there. The question is, do we really need to use it in MiniScript (or more specifically, MiniMicro)?
In Unity, where you may be using co-routines, yield makes sense to give other threads a chance to run. But since MiniScript doesn't (natively) allow co-routines, do we still need to yield for any behind-the-scene processes to run?
My game was naively yielding at the end of each game loop as I wasn't having any performance problems. Now that I'm implementing my own game tick system and have started analysing what "frame rate" I can run my game ticks at, I realised the yield statement I was using was throttling my code to 60 TPS (ticks per second), which I guess is the target frame rate for the graphics engine, which normally wouldn't be a problem, but as I was trying game tick values between 10-100 fps , and the yield was adding onto the time per tick, I was seeing very poor game tick rates.
When I removed the yield, I can get about 500 TPS.
I know if I embedded MiniScript in my own project, maybe I would implement something that would benefit from a yield command, but the crux of the question is, in MiniMicro, is the yield command there for our benefit, or yours? Can we ignore it if we don't need it?
Thanks. Russell.