/** Start counting, call this method just before performing the task you want to keep track of. Call {@link #stop()} when done. */ public void start () { startTime = TimeUtils.nanoTime(); valid = false; }
/** Stop counting, call this method right after you performed the task you want to keep track of. Call {@link #start()} again * when you perform more of that task. */ public void stop () { if (startTime > 0L) { current += (TimeUtils.nanoTime() - startTime) * nano2seconds; startTime = 0L; valid = true; } }
/** Stop counting, call this method right after you performed the task you want to keep track of. Call {@link #start()} again * when you perform more of that task. */ public void stop () { if (startTime > 0L) { current += (TimeUtils.nanoTime() - startTime) * nano2seconds; startTime = 0L; valid = true; } }
/** Get the time in nanos passed since a previous time * @param prevTime - must be nanoseconds * @return - time passed since prevTime in nanoseconds */ public static long timeSinceNanos (long prevTime) { return nanoTime() - prevTime; }
/** Start counting, call this method just before performing the task you want to keep track of. Call {@link #stop()} when done. */ public void start () { startTime = TimeUtils.nanoTime(); valid = false; }
/** @param duration * @return whether the user touched the screen for as much or more than the given duration. */ public boolean isLongPressed (float duration) { if (gestureStartTime == 0) return false; return TimeUtils.nanoTime() - gestureStartTime > (long)(duration * 1000000000l); }
/** Get the time in nanos passed since a previous time * @param prevTime - must be nanoseconds * @return - time passed since prevTime in nanoseconds */ public static long timeSinceNanos (long prevTime) { return nanoTime() - prevTime; }
/** @param duration * @return whether the user touched the screen for as much or more than the given duration. */ public boolean isLongPressed (float duration) { if (gestureStartTime == 0) return false; return TimeUtils.nanoTime() - gestureStartTime > (long)(duration * 1000000000l); }
@Override public void create () { lastFrameTime = TimeUtils.nanoTime(); }
/** 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 AssetLoadingTask (AssetManager manager, AssetDescriptor assetDesc, AssetLoader loader, AsyncExecutor threadPool) { this.manager = manager; this.assetDesc = assetDesc; this.loader = loader; this.executor = threadPool; startTime = manager.log.getLevel() == Logger.DEBUG ? TimeUtils.nanoTime() : 0; }
public AssetLoadingTask (AssetManager manager, AssetDescriptor assetDesc, AssetLoader loader, AsyncExecutor threadPool) { this.manager = manager; this.assetDesc = assetDesc; this.loader = loader; this.executor = threadPool; startTime = manager.log.getLevel() == Logger.DEBUG ? TimeUtils.nanoTime() : 0; }
/** 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 long t = TimeUtils.nanoTime(); if (lastTick > 0L) tick((t - lastTick) * nano2seconds); lastTick = t; }
public void tick () { final long t = TimeUtils.nanoTime(); if (lastTick > 0L) tick((t - lastTick) * nano2seconds); lastTick = t; }
private void queueTime () { long time = TimeUtils.nanoTime(); queue.add((int)(time >> 32)); queue.add((int)time); }
@Override public void render () { long frameTime = TimeUtils.nanoTime(); float deltaTime = (frameTime - lastFrameTime) / 1000000000.0f; lastFrameTime = frameTime; Gdx.app.log("DeltaTimeTest", "delta: " + deltaTime + ", gdx delta: " + Gdx.graphics.getDeltaTime()); } }
private void queueTime () { long time = TimeUtils.nanoTime(); queue.add((int)(time >> 32)); queue.add((int)time); }