Rainer Queck wrote:
Hello NG,
is there a possibillity to determine how long a thread had to wait on
Monitor.TryEnter(lockObj,timeout) ?
You could take a snapshot of DateTime.Now both before and after it
acquires the lock, subtract them and interrogate the resulting TimeSpan:
DateTime startAcquire = DateTime.Now;
Monitor.TryEnter(lockObj,timeout);
DateTime endAcquire = DateTime.Now;
TimeSpan waitTime = endAcquire - startAcquire;
Chris.