System.Threading.Watch.StartNew C# (CSharp) Method

StartNew() public static method

public static StartNew ( ) : Watch
return Watch
        public static Watch StartNew()
        {
            Watch watch = new Watch ();
            watch.Start ();
            return watch;
        }

Usage Example

Esempio n. 1
0
        public void TryEnter(int milliSeconds, ref bool lockTaken)
        {
            //Thread.BeginCriticalRegion();

            Watch sw = Watch.StartNew();

            while (sw.ElapsedMilliseconds < milliSeconds)
            {
                TryEnter(ref lockTaken);
            }
            sw.Stop();
        }
All Usage Examples Of System.Threading.Watch::StartNew