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