- Dear all,
Would you please tell me how I can create a timer for my model? A
timer which begins operating whenever I press the go button and ends
when I press the button again...
Would you please help me?
- Dear Leila,
You could use a flag and variable to make a loop timer. If you make a
reset button, a go button, and a monitor for time in a new model and
then paste this into the Procedures, you will see how it works.
globals [ running? time ]
set running? false
set time 0
if not running? [ set running? true reset-timer ] ; reset timer
first time through
set time timer ; show time since button pressed
When you press the go button to stop the loop, time will contain the
time the loop was running. Call reset before timing the next run. HTH.
On Jul 1, 2006, at 7:00 AM, leila_sur83 wrote:
> Dear all,
> Would you please tell me how I can create a timer for my model? A
> timer which begins operating whenever I press the go button and ends
> when I press the button again...
> Would you please help me?
> Kind Regards,
> Leila Hajibabai