|Anonymous | Login||06-22-2021 06:46 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details [ Jump to Notes ]||[ View Advanced ] [ Issue History ] [ Print ]|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0007683||[Squeak] Morphic||text||always||12-18-11 21:48||12-20-11 01:54|
|Summary||0007683: Morph>>stepTime Comment: explain that it's only a recommendation|
|Description||See http://forum.world.st/Implementing-a-simple-timer-td4202411.html [^]|
|Attached Files||Morph-stepTime.st [^] (484 bytes) 12-18-11 21:48|
(0014209 - 807 - 1043 - 1043 - 1043 - 1043 - 1043)
ElapsedTimer commentStamp: 'wiz 4/25/2009 18:44' prior: 0!
An ElapsedTimer is a very simple timer. It is responsible for knowing only two messages.
The useage is:
timer := ElapsedTimer new .
timer timeElapsed. "to start timing."
timer timeElapsing > timeLimit . "to test if a certain time has elapsed"
thisRun := timer timeElapsed . "to collect elapsed time and reset timer."
The advantages of having this class is the ability to have different timers each with their own state. Have one timer for laps while another one times the whole run.
I have found that really simple protocols suit my style and provide good maintainability.
You may want to repackage the class. Right now it is stored in my personal project name space.
Hth, --Jerome Peace
(0014210 - 679 - 743 - 743 - 743 - 743 - 743)
In the context of the question "how to use morphic step"
The morph would hold onto one or two timers.
One timer would be used to check if enough time has elapsed.
Once it has reset the timer and trigger the update.
The second timer would be started/reset only at the beginning of the time display. It would keep running track of how much time has passed since the starting event. That could then be added to the base time and shown as a the time string.
You could even keep a third timer to diagnose how often your morph is being stepped and create a histogram of times between steps. Then you'd be learning something!
Yours in service and curiosity, --Jerome Peace
|12-18-11 21:48||seandenigris||New Issue|
|12-18-11 21:48||seandenigris||File Added: Morph-stepTime.st|
|12-20-11 01:35||wiz||Note Added: 0014209|
|12-20-11 01:53||wiz||Note Added: 0014210|
|12-20-11 01:54||wiz||Note Added: 0014211|
|12-20-11 01:55||wiz||Note Deleted: 0014211|
| Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
44 total queries executed.|
30 unique queries executed.