public PerformanceCounter add (final String name) { PerformanceCounter result = new PerformanceCounter(name); counters.add(result); return result; }
/** {@inheritDoc} */ @Override public String toString () { final StringBuilder sb = new StringBuilder(); return toString(sb).toString(); }
public static void getKthNearestEnemy (boolean silent, int k) { Dummy kthDummy = null; perf.reset(); allPerf.start(); for (Dummy d : player) { Dummy found = d.getKthNearestEnemy(k); } allPerf.stop(); allPerf.tick(); if (silent) return; print(String.format("found nearest. min: %.4f, max: %.4f, avg: %.4f, total: %.3f ms", perf.time.min * 1000, perf.time.max * 1000, perf.time.average * 1000, perf.time.total * 1000)); }
@Override public void update () { super.update(); // Not using dynamics, so update the collision world manually if (world.performanceCounter != null) world.performanceCounter.start(); world.collisionWorld.performDiscreteCollisionDetection(); if (world.performanceCounter != null) world.performanceCounter.stop(); }
public void tick (final float deltaTime) { for (int i = 0; i < counters.size; i++) counters.get(i).tick(deltaTime); }
PerformanceCounter performanceCounter = new PerformanceCounter(); performanceCounter.CategoryName = "Process"; performanceCounter.CounterName = "Working Set"; performanceCounter.InstanceName = Process.GetCurrentProcess().ProcessName; Console.WriteLine(((uint)performanceCounter.NextValue()/1024).ToString("N0"));
/** Updates the time and load counters and resets the time. Call {@link #start()} to begin a new count. The values are only * valid after at least two calls to this method. */ public void tick () { final long t = TimeUtils.nanoTime(); if (lastTick > 0L) tick((t - lastTick) * nano2seconds); lastTick = t; }
System.Diagnostics.PerformanceCounter ramCounter = new PerformanceCounter("Memory", "Available MBytes"); Debug.Log(ramCounter.NextValue()+"MB");
@Override public void update () { super.update(); // Not using dynamics, so update the collision world manually if (USE_BULLET_FRUSTUM_CULLING) { if (world.performanceCounter != null) world.performanceCounter.start(); world.collisionWorld.performDiscreteCollisionDetection(); if (world.performanceCounter != null) world.performanceCounter.stop(); } }
@Override public void update () { if (performanceCounter != null) { performanceCounter.tick(); performanceCounter.start(); } if (collisionWorld instanceof btDynamicsWorld) ((btDynamicsWorld)collisionWorld).stepSimulation(Gdx.graphics.getDeltaTime(), maxSubSteps, fixedTimeStep); if (performanceCounter != null) performanceCounter.stop(); }
/** Updates the time and load counters and resets the time. Call {@link #start()} to begin a new count. The values are only * valid after at least two calls to this method. */ public void tick () { final long t = TimeUtils.nanoTime(); if (lastTick > 0L) tick((t - lastTick) * nano2seconds); lastTick = t; }
public PerformanceCounter add (final String name) { PerformanceCounter result = new PerformanceCounter(name); counters.add(result); return result; }
/** {@inheritDoc} */ @Override public String toString () { final StringBuilder sb = new StringBuilder(); return toString(sb).toString(); }
@Override protected void renderWorld () { if (world.performanceCounter != null) world.performanceCounter.start(); if (USE_BULLET_FRUSTUM_CULLING) getEntitiesCollidingWithObject(world, frustumObject, visibleEntities, tempManifoldArr); else { visibleEntities.clear(); for (int i = 0; i < world.entities.size; i++) { final BulletEntity e = world.entities.get(i); if (e == frustumEntity) continue; e.modelInstance.transform.getTranslation(tmpV); if (frustumCam.frustum.sphereInFrustum(tmpV, 1)) visibleEntities.add(e); } } if (world.performanceCounter != null) world.performanceCounter.stop(); for (int i = 0; i < visibleEntities.size; i++) visibleEntities.get(i).setColor(Color.RED); modelBatch.begin(camera); if ((state & CULL_FRUSTUM) == CULL_FRUSTUM) { world.render(modelBatch, environment, visibleEntities); world.render(modelBatch, environment, frustumEntity); } else world.render(modelBatch, environment); modelBatch.end(); for (int i = 0; i < visibleEntities.size; i++) visibleEntities.get(i).setColor(Color.GRAY); }
@Override public void render () { Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); fpsCounter.put(Gdx.graphics.getFramesPerSecond()); performanceCounter.tick(); performanceCounter.start(); ((btDynamicsWorld)collisionWorld).stepSimulation(Gdx.graphics.getDeltaTime(), 5); performanceCounter.stop(); int c = motionStates.size; for (int i = 0; i < c; i++) { motionStates.get(i).getWorldTransform(instances.get(i).transform); } modelBatch.begin(camera); modelBatch.render(instances, lights); modelBatch.end(); performance.setLength(0); performance.append("FPS: ").append(fpsCounter.value).append(", Bullet: ") .append((int)(performanceCounter.load.value * 100f)).append("%"); }
public void tick (final float deltaTime) { for (int i = 0; i < counters.size; i++) counters.get(i).tick(deltaTime); }
public PerformanceCounter add (final String name, final int windowSize) { PerformanceCounter result = new PerformanceCounter(name, windowSize); counters.add(result); return result; }
public StringBuilder toString (final StringBuilder sb) { sb.setLength(0); for (int i = 0; i < counters.size; i++) { if (i != 0) sb.append("; "); counters.get(i).toString(sb); } return sb; } }