public void TestInt64()
        {
            TestInt64(0);
            TestInt64(-1);
            TestInt64(( Int64 )1);
            TestInt64(Int64.MinValue);
            TestInt64(Int64.MaxValue);
            var sw   = Stopwatch.StartNew();
            var rand = new TestRandom();

            for (int i = 0; i < 1000; i++)
            {
                TestInt64(rand.NextInt64());
            }
            sw.Stop();
            Console.WriteLine("Int64: {0:0.###} msec/object", sw.ElapsedMilliseconds / 1000.0);
        }
Esempio n. 2
0
        public void TestAsInt64()
        {
            TestAsInt64(0);
            TestAsInt64(127);
            TestAsInt64(128);
            TestAsInt64(-1);
            TestAsInt64(-31);
            TestAsInt64(-32);
            TestAsInt64(( Int64 )1);
            TestAsInt64(Int64.MinValue);
            TestAsInt64(Int64.MaxValue);
            var sw   = Stopwatch.StartNew();
            var rand = new TestRandom();

            for (int i = 0; i < 100000; i++)
            {
                TestAsInt64(rand.NextInt64());
            }
            sw.Stop();
            Console.WriteLine("Int64: {0:#,0.###} usec/object", sw.Elapsed.Ticks / 1000000.0);
        }
        public void TestAsInt64()
        {
            TestAsInt64(0);
            TestAsInt64(127);
            TestAsInt64(128);
            TestAsInt64(-1);
            TestAsInt64(-31);
            TestAsInt64(-32);
            TestAsInt64(( Int64 )1);
            TestAsInt64(Int64.MinValue);
            TestAsInt64(Int64.MaxValue);

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