fix - ticks to millis

This commit is contained in:
ikpil 2023-03-24 10:58:11 +09:00
parent a8f9566105
commit 5d5637143b
9 changed files with 17 additions and 17 deletions

View File

@ -507,8 +507,8 @@ public class RecastDemo
cameraPos[1] += (float)((_moveUp - _moveDown) * keySpeed * dt); cameraPos[1] += (float)((_moveUp - _moveDown) * keySpeed * dt);
// long time = Stopwatch.GetTimestamp() / 1000; // long time = Stopwatch.GetTimestamp();
// //float dt = (time - prevFrameTime) / 1000000.0f; // //float dt = (time - prevFrameTime) / TimeSpan.TicksPerMillisecond;
// prevFrameTime = time; // prevFrameTime = time;
// //
// // Update sample simulation. // // Update sample simulation.
@ -605,7 +605,7 @@ public class RecastDemo
sample.update(sample.getInputGeom(), buildResult.Item1, buildResult.Item2); sample.update(sample.getInputGeom(), buildResult.Item1, buildResult.Item2);
sample.setChanged(false); sample.setChanged(false);
settingsUI.setBuildTime((Stopwatch.GetTimestamp() - t) / 1_000_000); settingsUI.setBuildTime((Stopwatch.GetTimestamp() - t) / TimeSpan.TicksPerMicrosecond);
toolsUI.setSample(sample); toolsUI.setSample(sample);
} }
} }

View File

@ -271,7 +271,7 @@ public class CrowdProfilingTool
} }
} }
crowdUpdateTime = (endTime - startTime) / 1_000_000; crowdUpdateTime = (endTime - startTime) / TimeSpan.TicksPerMicrosecond;
} }
private void moveMob(NavMeshQuery navquery, QueryFilter filter, CrowdAgent ag, AgentData agentData) private void moveMob(NavMeshQuery navquery, QueryFilter filter, CrowdAgent ag, AgentData agentData)

View File

@ -676,7 +676,7 @@ public class CrowdTool : Tool
m_agentDebug.vod.normalizeSamples(); m_agentDebug.vod.normalizeSamples();
// m_crowdSampleCount.addSample((float) crowd.getVelocitySampleCount()); // m_crowdSampleCount.addSample((float) crowd.getVelocitySampleCount());
crowdUpdateTime = (endTime - startTime) / 1_000_000; crowdUpdateTime = (endTime - startTime) / TimeSpan.TicksPerMicrosecond;
} }
private void hilightAgent(CrowdAgent agent) private void hilightAgent(CrowdAgent agent)

View File

@ -183,7 +183,7 @@ public class DynamicUpdateTool : Tool
long t1 = Stopwatch.GetTimestamp(); long t1 = Stopwatch.GetTimestamp();
float? hitPos = dynaMesh.voxelQuery().raycast(sp, ep); float? hitPos = dynaMesh.voxelQuery().raycast(sp, ep);
long t2 = Stopwatch.GetTimestamp(); long t2 = Stopwatch.GetTimestamp();
raycastTime = (t2 - t1) / 1_000_000L; raycastTime = (t2 - t1) / TimeSpan.TicksPerMicrosecond;
raycastHit = hitPos.HasValue; raycastHit = hitPos.HasValue;
raycastHitPos = hitPos.HasValue raycastHitPos = hitPos.HasValue
? new float[] { sp[0] + hitPos.Value * (ep[0] - sp[0]), sp[1] + hitPos.Value * (ep[1] - sp[1]), sp[2] + hitPos.Value * (ep[2] - sp[2]) } ? new float[] { sp[0] + hitPos.Value * (ep[0] - sp[0]), sp[1] + hitPos.Value * (ep[1] - sp[1]), sp[2] + hitPos.Value * (ep[2] - sp[2]) }
@ -468,7 +468,7 @@ public class DynamicUpdateTool : Tool
bool updated = dynaMesh.update(executor).Result; bool updated = dynaMesh.update(executor).Result;
if (updated) if (updated)
{ {
buildTime = (Stopwatch.GetTimestamp() - t) / 1_000_000; buildTime = (Stopwatch.GetTimestamp() - t) / TimeSpan.TicksPerMicrosecond;
sample.update(null, dynaMesh.recastResults(), dynaMesh.navMesh()); sample.update(null, dynaMesh.recastResults(), dynaMesh.navMesh());
sample.setChanged(false); sample.setChanged(false);
} }
@ -720,7 +720,7 @@ public class DynamicUpdateTool : Tool
Console.WriteLine(e); Console.WriteLine(e);
} }
buildTime = (Stopwatch.GetTimestamp() - t) / 1_000_000; buildTime = (Stopwatch.GetTimestamp() - t) / TimeSpan.TicksPerMicrosecond;
sample.update(null, dynaMesh.recastResults(), dynaMesh.navMesh()); sample.update(null, dynaMesh.recastResults(), dynaMesh.navMesh());
} }

View File

@ -51,7 +51,7 @@ namespace DotRecast.Recast
{ {
foreach (var (n, v) in timerAccum) foreach (var (n, v) in timerAccum)
{ {
Console.WriteLine(n + ": " + v.Read() / 1000000); Console.WriteLine(n + ": " + v.Read() / TimeSpan.TicksPerMillisecond);
} }
} }
} }

View File

@ -133,7 +133,7 @@ public class RandomPointTest : AbstractDetourTest
} }
long t3 = Stopwatch.GetTimestamp(); long t3 = Stopwatch.GetTimestamp();
Console.WriteLine("Random point around circle: " + (t2 - t1) / 1000000 + "ms"); Console.WriteLine("Random point around circle: " + (t2 - t1) / TimeSpan.TicksPerMillisecond + "ms");
Console.WriteLine("Random point within circle: " + (t3 - t2) / 1000000 + "ms"); Console.WriteLine("Random point within circle: " + (t3 - t2) / TimeSpan.TicksPerMillisecond + "ms");
} }
} }

View File

@ -202,8 +202,8 @@ public class TileCacheTest : AbstractTileCacheTest
} }
long t3 = Stopwatch.GetTimestamp(); long t3 = Stopwatch.GetTimestamp();
Console.WriteLine(" Time ST : " + (t2 - t1) / 1000000); Console.WriteLine(" Time ST : " + (t2 - t1) / TimeSpan.TicksPerMillisecond);
Console.WriteLine(" Time MT : " + (t3 - t2) / 1000000); Console.WriteLine(" Time MT : " + (t3 - t2) / TimeSpan.TicksPerMillisecond);
TileCache tc = getTileCache(geom, order, cCompatibility); TileCache tc = getTileCache(geom, order, cCompatibility);
foreach (byte[] layer in layers) foreach (byte[] layer in layers)
{ {

View File

@ -257,8 +257,8 @@ public class RecastSoloMeshTest
Assert.That(m_dmesh.nverts, Is.EqualTo(expDetVerts), "Mesh Detail Verts"); Assert.That(m_dmesh.nverts, Is.EqualTo(expDetVerts), "Mesh Detail Verts");
Assert.That(m_dmesh.ntris, Is.EqualTo(expDetTris), "Mesh Detail Tris"); Assert.That(m_dmesh.ntris, Is.EqualTo(expDetTris), "Mesh Detail Tris");
long time2 = Stopwatch.GetTimestamp(); long time2 = Stopwatch.GetTimestamp();
Console.WriteLine(filename + " : " + partitionType + " " + (time2 - time) / 1000000 + " ms"); Console.WriteLine(filename + " : " + partitionType + " " + (time2 - time) / TimeSpan.TicksPerMillisecond + " ms");
Console.WriteLine(" " + (time3 - time) / 1000000 + " ms"); Console.WriteLine(" " + (time3 - time) / TimeSpan.TicksPerMillisecond + " ms");
saveObj(filename.Substring(0, filename.LastIndexOf('.')) + "_" + partitionType + "_detail.obj", m_dmesh); saveObj(filename.Substring(0, filename.LastIndexOf('.')) + "_" + partitionType + "_detail.obj", m_dmesh);
saveObj(filename.Substring(0, filename.LastIndexOf('.')) + "_" + partitionType + ".obj", m_pmesh); saveObj(filename.Substring(0, filename.LastIndexOf('.')) + "_" + partitionType + ".obj", m_pmesh);
m_ctx.print(); m_ctx.print();

View File

@ -119,8 +119,8 @@ public class RecastTileMeshTest
} }
long t3 = Stopwatch.GetTimestamp(); long t3 = Stopwatch.GetTimestamp();
Console.WriteLine(" Time ST : " + (t2 - t1) / 1000000); Console.WriteLine(" Time ST : " + (t2 - t1) / TimeSpan.TicksPerMillisecond);
Console.WriteLine(" Time MT : " + (t3 - t2) / 1000000); Console.WriteLine(" Time MT : " + (t3 - t2) / TimeSpan.TicksPerMillisecond);
} }
private void build(InputGeomProvider geom, RecastBuilder builder, RecastConfig cfg, int threads, bool validate) private void build(InputGeomProvider geom, RecastBuilder builder, RecastConfig cfg, int threads, bool validate)