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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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
More Pages to Explore .....