public long Run()
        {
            gc();
            Console.WriteLine("testing " + _buffer.GetType() + " with " + _numberOfUpdates + " updates...");
            var stopWatch = new StopWatch();

            var producer = new Producer(_buffer, NumberOfInstruments, _numberOfUpdates, PoisonPill, stopWatch);
            var consumer = new Consumer(_buffer, NumberOfInstruments, PoisonPill, stopWatch);

            var producerThread = new Thread(producer.Run);
            var consumerThread = new Thread(consumer.Run);

            producerThread.Start();
            consumerThread.Start();

            consumerThread.Join();

            return ComputeAndPrintResults(consumer, stopWatch.nanosTaken());
        }
        private long ComputeAndPrintResults(Consumer consumer, long nanosTaken)
        {
            for (int i = 0; i < consumer.LatestSnapshots.Length; i++)
            {
                Console.WriteLine(consumer.LatestSnapshots[i]);
            }

            Console.WriteLine(String.Format("\ntime {0}", nanosTaken / 1000000000.0));

            double compressionRatio = (1.0 * _numberOfUpdates) / consumer.ReadCounter;
            Console.WriteLine(String.Format("compression ratio = {0}", compressionRatio));

            double megaOpsPerSecond = (1000.0 * _numberOfUpdates) / nanosTaken;
            Console.WriteLine(String.Format("mops = {0}", megaOpsPerSecond));

            return Convert.ToInt64(megaOpsPerSecond);
        }