robocraft.player
Class Clock

java.lang.Object
  extended byrobocraft.player.Clock

public class Clock
extends java.lang.Object

A Robot's internal clock.


Method Summary
static int getBytecodeNum()
          Returns the number of bytecode instructions since the beginning of the round.
static int getBytecodesPerRound()
          Returns the constant number of bytecodes executed by the calling robot's virtual machine each round.
static int getRoundNum()
          Returns the number of the current round according to the robot's internal clock, which starts at 0 when the robot's program starts running and is incremented when a round ends.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRoundNum

public static int getRoundNum()
Returns the number of the current round according to the robot's internal clock, which starts at 0 when the robot's program starts running and is incremented when a round ends. This is effectively the "age" of the robot.


getBytecodeNum

public static int getBytecodeNum()
Returns the number of bytecode instructions since the beginning of the round. A single instruction may be an arithmetic operation, a field access, or an instantiation, for example. This number is between 0 inclusive and getBytecodesPerRound() exclusive.

A disassembly of your class files will show you how many instructions each line of your Java code is compiled into.


getBytecodesPerRound

public static int getBytecodesPerRound()
Returns the constant number of bytecodes executed by the calling robot's virtual machine each round.