/** 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 void tick (final float deltaTime) { for (int i = 0; i < counters.size; i++) counters.get(i).tick(deltaTime); }
/** 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 void tick (final float deltaTime) { for (int i = 0; i < counters.size; i++) counters.get(i).tick(deltaTime); }
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)); }
public Dummy getKthNearestEnemy (int k) { perf.start(); originDummy = this; Dummy found = enemy.selectRanked(distComp, k); // print(this + " found enemy: " + found); perf.stop(); perf.tick(); if (verify) { verifyCorrectness(found, k); } return found; }
@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(); }
@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); }
/** 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; }