forked from mirror/DotRecast
benchmark
This commit is contained in:
parent
3ae7582043
commit
f81975d97a
|
@ -29,11 +29,14 @@ namespace DotRecast.Detour.Test;
|
||||||
public class RandomPointTest : AbstractDetourTest
|
public class RandomPointTest : AbstractDetourTest
|
||||||
{
|
{
|
||||||
[Test]
|
[Test]
|
||||||
|
[Repeat(10)]
|
||||||
public void TestRandom()
|
public void TestRandom()
|
||||||
{
|
{
|
||||||
RcRand f = new RcRand(1);
|
RcRand f = new RcRand(1);
|
||||||
IDtQueryFilter filter = new DtQueryDefaultFilter();
|
IDtQueryFilter filter = new DtQueryDefaultFilter();
|
||||||
for (int i = 0; i < 1000; i++)
|
|
||||||
|
var begin = RcFrequency.Ticks;
|
||||||
|
for (int i = 0; i < 10000; i++)
|
||||||
{
|
{
|
||||||
var status = query.FindRandomPoint(filter, f, out var randomRef, out var randomPt);
|
var status = query.FindRandomPoint(filter, f, out var randomRef, out var randomPt);
|
||||||
Assert.That(status.Succeeded(), Is.True);
|
Assert.That(status.Succeeded(), Is.True);
|
||||||
|
@ -55,6 +58,9 @@ public class RandomPointTest : AbstractDetourTest
|
||||||
Assert.That(randomPt.Z >= bmin[1], Is.True);
|
Assert.That(randomPt.Z >= bmin[1], Is.True);
|
||||||
Assert.That(randomPt.Z <= bmax[1], Is.True);
|
Assert.That(randomPt.Z <= bmax[1], Is.True);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var ticks = RcFrequency.Ticks - begin;
|
||||||
|
Console.WriteLine($"RandomPointTest::TestRandom() - {(double)ticks / TimeSpan.TicksPerMillisecond} ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
Loading…
Reference in New Issue