I'm very new to this so please forgive the questions possibly ill-stated nature.
Firstly is this even a valid way to speedtest:
public function L1() {
tree.x = 200;
tree.y = 200;
tree.healthPoints = 0;
addChild(tree);
var myTimer:Timer = new Timer(100,60);
myTimer.addEventListener(TimerEvent.TIMER,someFunction);
myTimer.start();
addEventListener(Event.ENTER_FRAME, speedTest)
}
function someFunction(event:TimerEvent) {
t++
}
public function speedTest (e:Event) {
if (tree != null) {
do { tree.healthPoints += 1; }
while (tree.healthPoints < 10000) ;
tree.healthPoints = 0;
trace (t);
}
}
Secondly: I want to actually speed-test the entire game somehow to check if adding new features or rewriting current features actually optimizes the game or not.
What are some ways to do this?