NSoft.NFramework.WithOperationTimerFixture.CallsDelegateAndReturnNonZeroTiming C# (CSharp) Method

CallsDelegateAndReturnNonZeroTiming() private method

private CallsDelegateAndReturnNonZeroTiming ( ) : void
return void
        public void CallsDelegateAndReturnNonZeroTiming() {
            bool called = false;
            double msecs = With.OperationTimer(delegate {
                                                   called = true;
                                                   ThreadTool.Sleep(40);
                                               });

            // The only reliable way of testing this that I can think of.
            Assert.IsTrue(msecs > 0);
            Assert.IsTrue(called);

            Console.WriteLine("Operation elapsed time (msec): " + msecs);
        }