Ejemplo n.º 1
0
        public void TestUInt64()
        {
            TestUInt64(0);
            TestUInt64(( UInt64 )1);
            TestUInt64(UInt64.MinValue);
            TestUInt64(UInt64.MaxValue);
            var sw   = Stopwatch.StartNew();
            var rand = new TestRandom();

            for (int i = 0; i < 1000; i++)
            {
                TestUInt64(rand.NextUInt64());
            }
            sw.Stop();
            Console.WriteLine("UInt64: {0:0.###} msec/object", sw.ElapsedMilliseconds / 1000.0);
        }
        public void TestAsUInt64()
        {
            TestAsUInt64(0);
            TestAsUInt64(127);
            TestAsUInt64(128);
            TestAsUInt64(( UInt64 )1);
            TestAsUInt64(UInt64.MinValue);
            TestAsUInt64(UInt64.MaxValue);

#if !SILVERLIGHT
            var sw   = Stopwatch.StartNew();
            var rand = new TestRandom();
            for (int i = 0; i < 1000; i++)
            {
                TestAsUInt64(rand.NextUInt64());
            }
            sw.Stop();
            Console.WriteLine("UInt64: {0:#,0.###} usec/object", GetMicroseconds(sw));
#endif // !SILVERLIGHT
        }
		public void TestAsUInt64()
		{
			TestAsUInt64( 0 );
			TestAsUInt64( 127 );
			TestAsUInt64( 128 );
			TestAsUInt64( ( UInt64 )1 );
			TestAsUInt64( UInt64.MinValue );
			TestAsUInt64( UInt64.MaxValue );
			var sw = Stopwatch.StartNew();
			var rand = new TestRandom();
			for ( int i = 0; i < 100000; i++ )
			{
				TestAsUInt64( rand.NextUInt64() );
			}
			sw.Stop();
			Console.WriteLine( "UInt64: {0:#,0.###} usec/object", sw.Elapsed.Ticks / 1000000.0 );
		}
		public void TestUInt64()
		{
			TestUInt64( 0 );
			TestUInt64( ( UInt64 )1 );
			TestUInt64( UInt64.MinValue );
			TestUInt64( UInt64.MaxValue );
			var sw = Stopwatch.StartNew();
			var rand = new TestRandom();
			for ( int i = 0; i < 1000; i++ )
			{
				TestUInt64( rand.NextUInt64() );
			}
			sw.Stop();
			Debug.WriteLine( "UInt64: {0:0.###} msec/object", sw.ElapsedMilliseconds / 1000.0 );
		}