mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkReaderTest: stopwatch not needed, Unity already shows the time
This commit is contained in:
parent
2f7a67e3f9
commit
84fc240d00
@ -16,18 +16,14 @@ public class NetworkReaderTest
|
||||
public void Benchmark()
|
||||
{
|
||||
// 10 million reads, Unity 2019.3, code coverage disabled
|
||||
// 4096ms (+GC later)
|
||||
// 4049ms (+GC later)
|
||||
byte[] bytes = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C};
|
||||
Stopwatch watch = new Stopwatch();
|
||||
watch.Start();
|
||||
for (int i = 0; i < 10000000; ++i)
|
||||
{
|
||||
ArraySegment<byte> segment = new ArraySegment<byte>(bytes);
|
||||
NetworkReader reader = new NetworkReader(segment);
|
||||
Vector3 value = reader.ReadVector3();
|
||||
}
|
||||
watch.Stop();
|
||||
Debug.Log("NetworkReaderTest Benchmark: " + watch.ElapsedMilliseconds + " ms");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
Loading…
Reference in New Issue
Block a user