NextByte() public method

Generates a signle random byte with range [0,255]. This method's performance is improved by generating 4 bytes in one operation and storing them ready for future calls.
public NextByte ( ) : byte
return byte
示例#1
0
        public void NextByte()
        {
            int sampleCount = 10000000;
            XorShiftRandom rng = new XorShiftRandom();
            byte[] sampleArr = new byte[sampleCount];
            for(int i=0; i<sampleCount; i++){
                sampleArr[i] = rng.NextByte();

            }
            NextByteInner(sampleArr);
        }