org.jagatoo.logging
Class ProfileTimer

java.lang.Object
  extended by org.jagatoo.logging.ProfileTimer

public class ProfileTimer
extends java.lang.Object

ProfileTimer is used as an internal profiling class for the whole engine.


Nested Class Summary
static class ProfileTimer.ProfileContainer
          Contains a thread's worth of profile nodes.
static class ProfileTimer.ProfileNode
           
 
Method Summary
static java.lang.String currentProfileName()
           
static void endProfile()
          End a profile
static long getResolution()
           
static long getTime()
           
static boolean isProfilingEnabled()
           
static void printLogs()
          Print all logs.
static void setProfilingEnabled(boolean enable, TimerInterface timerInstance)
          Enabled/disable profiling
static void startProfile(LogChannel channel, java.lang.String name)
          Start a new profile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setProfilingEnabled

public static void setProfilingEnabled(boolean enable,
                                       TimerInterface timerInstance)
Enabled/disable profiling

Parameters:
enable -
timerInstance - A timer used to profile

isProfilingEnabled

public static final boolean isProfilingEnabled()

startProfile

public static void startProfile(LogChannel channel,
                                java.lang.String name)
Start a new profile


currentProfileName

public static java.lang.String currentProfileName()
Returns:
the name of the current profile

endProfile

public static void endProfile()
End a profile


printLogs

public static void printLogs()
Print all logs. If timer is null, instantly returns.


getTime

public static long getTime()
Returns:
time in nanoseconds

getResolution

public static long getResolution()
Returns:
Timer resolution