public static ServerWatch StartNew() { ServerWatch watch = new ServerWatch(); watch.Start(); return(watch); }
public static bool SpinUntil(MyFunc <bool> condition, int millisecondsTimeout) { ServerSpinWait sw = new ServerSpinWait(); ServerWatch watch = ServerWatch.StartNew(); while (!condition()) { if (watch.ElapsedMilliseconds > millisecondsTimeout) { return(false); } sw.SpinOnce(); } return(true); }
public static ServerWatch StartNew() { ServerWatch watch = new ServerWatch (); watch.Start (); return watch; }