Can anyone point me to any articles or examples on understanding and coding timers? The specific thing I want to attempt is to time how long it takes a player to complete a task. In other words once a verb is clicked to pick up an item a timer starts ,the player can then go about thier buisness if they wish, the goal is to get the item to a destination as quickly as possible. When they reach the dest I want to be able to determine how long it took to get there.
I am not looking for code to do this as much as an information to help me understand how to use and code them.
Thanks in advance for you help
-Shwn
ID:178796
Apr 3 2002, 4:34 pm
|
|
In response to Rcet
|
|
Well I would fall into the newbie catagory for sure. However I come from the philosophy of give a man "a code" and he fixes one problem, help him understand the concept and he codes for ever. Here is what is unclear to me about timers.
When you start a timer how do you tell the timer to stop timing and return the elapsed time? |
In response to Shwn
|
|
Here's a small example:
var/timer = 100 // Creates global time var Hope that helps you learn a bit. |
As I can see, you aren't just a newbie begging for "codes".
The best way to go about doing this is making a proc, and a var called time. Then, once the task is executed, call the proc. Have the proc add 1 to it every second (sleep(10)). Then, once they have finished the task, just display the var that you have been adding to.
Hope I helped
-Rcet