actually what i'm trying to do is if alarm button is false, turtle will only wander in the enviroment, then when emergency alarm is on, turtle will leave the building and time-to-evacuate will start increment until last of agents leave. i think i can't write the "set time-to-evacuate time-to-evacuate + 1" in the go procedure, because that will make time-to-evacuate is start counting even the emergency alarm is off. thanks. can someone give me an idea how to solve this problem.

```
globals
[
time-to-evacuate
flag-active-alarm
]

to go
ask turtles [wander]
if (flag-active-alarm )[active-alarm] 
tick
end

to wander
[....]
 end

to active-alarm
set flag-active-alarm true
set time-to-evacuate 0
set time-to-evacuate time-to-evacuate + 1
ask turtles [move]

if all? turtles [ pcolor = red ]   ;stops simuation
[ stop ]
end

to move
avoid-obstacles1 
end

```