is this a sensible way to wait in a program?

I needed a way to just wait for a slight duration before continuing running the program. I have nothing inside the while on purpose, but I don't know if this is a valid way of solving it.

So I call the function with pauser(0.1) to have that tenth of a second pause.

public static void pauser(double duration) { DateTime timerStart = DateTime.Now; do { } while (timerStart.AddSeconds(duration) > DateTime.Now); } 

by TheAI via /r/csharp

Leave a Reply