Quantcast
Channel: Answers for "Keeping track of time?"
Browsing latest articles
Browse All 9 View Live

Answer by zeropoint

How are you exactly counting 1s? This does work: // Prints 0 print (Time.time); // Waits 5 seconds yield WaitForSeconds (5); // Prints 5.0 print (Time.time); It's from [documentation][1]. [1]:...

View Article



Answer by zeropoint

I don't think we have directly such method to achieve that but you can surely go for polling void YourCoroutine(float waitTime){ float localTime = Time.time; // store the entry point time // your stuff...

View Article

Answer by CHPedersen

Try something like this: System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); IEnumerator SomeCoroutine() { stopwatch.Start(); // Do operations stopwatch.Stop(); float timeTaken...

View Article

Answer by aldonaletto

You can set the endTime at beginning, and let the routine check it before returning: function OneSecondRoutine(){ var endTime = Time.time + 1; // do your stuff here // wait endTime to finish: while...

View Article
Browsing latest articles
Browse All 9 View Live




Latest Images