Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library RecycleTimers
- struct SimpleTimers extends array
- private static timer array availableTimers
- private static integer maxAvailable=-1
- public static method release takes timer time returns nothing
- call PauseTimer(time)
- set maxAvailable=maxAvailable+1
- set availableTimers[maxAvailable]=time
- endmethod
- public static method get takes nothing returns timer
- if maxAvailable==-1 then
- return CreateTimer()
- endif
- set maxAvailable=maxAvailable-1
- return availableTimers[maxAvailable+1]
- endmethod
- endstruct
- endlibrary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement