Time: 18 January 2015, 8:33:51.264 pm
Simplified and improved WorldState >> #interCyclePause:
- don't create a new Delay (along with a new Semaphore) every 20 (or 50) milliseconds
- use #millisecondsSince: to avoid the effects of the clock rollover
- separated the code of time calculation and actual waiting
Depends on Kernel-ul.893
=============== Diff against Morphic-bf.753 ===============
!WorldState commentStamp: 'ls 7/10/2003 19:30' prior: 0!
The state of a Morphic world. (This needs some serious commenting!!!!)
The MinCycleLapse variable holds the minimum amount of time that a morphic cycle is allowed to take. If a cycle takes less than this, then interCyclePause: will wait until the full time has been used up.!
Item was changed:
----- Method: WorldState>>interCyclePause: (in category 'update cycle') -----
"delay enough that the previous cycle plus the amount of delay will equal milliSecs. If the cycle is already expensive, then no delay occurs. However, if the system is idly waiting for interaction from the user, the method will delay for a proportionally long time and cause the overall CPU usage of Squeak to be low.
If the preference #serverMode is enabled, always do a complete delay of 50ms, independant of my argument. This prevents the freezing problem described in Mantis #6581"