initial commit, kind of working.
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package com.arc.flixel
|
||||
{
|
||||
import flash.utils.getTimer;
|
||||
|
||||
public class Profiler
|
||||
{
|
||||
|
||||
private static const ENABLED:Boolean = false;
|
||||
|
||||
private var name:String;
|
||||
|
||||
private var time:Number = 0;
|
||||
|
||||
public function Profiler(param1:String, param2:String = null)
|
||||
{
|
||||
super();
|
||||
this.name = "[" + param1 + "]";
|
||||
this.start(param2);
|
||||
}
|
||||
|
||||
public function start(param1:String = null) : void
|
||||
{
|
||||
if(param1 == null)
|
||||
{
|
||||
param1 = "started";
|
||||
}
|
||||
if(ENABLED)
|
||||
{
|
||||
}
|
||||
this.time = getTimer();
|
||||
}
|
||||
|
||||
public function lap(param1:String = null) : void
|
||||
{
|
||||
this.end(param1);
|
||||
this.time = getTimer();
|
||||
}
|
||||
|
||||
public function end(param1:String = null) : int
|
||||
{
|
||||
if(param1 == null)
|
||||
{
|
||||
param1 = "elapsed";
|
||||
}
|
||||
if(ENABLED)
|
||||
{
|
||||
}
|
||||
return getTimer() - this.time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user