Exemplo n.º 1
0
        public void TestJetThreadstatsToStringPerf()
        {
            var t = new JET_THREADSTATS
            {
                cPageReferenced = 10,
                cPageRead       = 5,
                cPagePreread    = 4,
                cPageDirtied    = 3,
                cPageRedirtied  = 2,
                cLogRecord      = 1,
                cbLogRecord     = 0,
            };

            // Call the method once to make sure it is compiled.
            string ignored = t.ToString();

            const int      N = 100000;
            EsentStopwatch s = EsentStopwatch.StartNew();

            for (int i = 0; i < N; ++i)
            {
                ignored = t.ToString();
            }

            s.Stop();

            double ms = Math.Max(1, s.Elapsed.Milliseconds);

            EseInteropTestHelper.ConsoleWriteLine("{0} calls in {1} ({2} ms/call)", N, s.Elapsed, ms / N);
        }
        public void TestStartAndStopEsentStopwatch()
        {
            var stopwatch = new EsentStopwatch();

            stopwatch.Start();
            stopwatch.Stop();
        }
        public void TestStoppedStopwatchToString()
        {
            var stopwatch = new EsentStopwatch();

            stopwatch.Start();
            stopwatch.Stop();
            Assert.AreEqual(stopwatch.Elapsed.ToString(), stopwatch.ToString());
        }