busy-loop

Good way to create an idle loop in C#?

I have an app it sets up a FileSystemWatcher. It should run indefinitely. What is the best way to have it run in an idle loop? I'm currently doing FileSystemWatcher watch = ... //setup the watcher watch.EnableRaisingEvents = true; while (true) { Thread.Sleep(int.MaxValue); } which seems to work (ie, captures the events and does...

prettify will cause "script is busy" warning if the code is long

I'm using prettify by Google. How to fix? ...