Utilizing Time in your code
ElapsedTime()
ElapsedTime is a class that can easily get you the amount of time that has passed since you pressed init() and to the current time step.
Instructions for use:
First create the variable at the top of your code.
2. Then create assign it to a new instance of the class.
3. Then make sure that it starts when you click the start button
4. Then use it inside your loop using these methods:
timeMilliseconds()
timeSeconds()
timeMinutes()
For Example:
Last updated