xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"
initialize="initTimer()">
import flash.utils.Timer;
import flash.events.TimerEvent;
[Bindable]
public var time:Number = 0;
[Bindable]
public var totmem:Number = 0;
[Bindable]
public var maxmem:Number = 0;
public function initTimer():void {
// The first parameter is the interval (in milliseconds). The
// second parameter is number of times to run (0 means infinity).
var myTimer:Timer = new Timer(1000, 0);
myTimer.addEventListener("timer", timerHandler);
myTimer.start();
}
public function timerHandler(event:TimerEvent):void {
time = getTimer();
totmem = flash.system.System.totalMemory;
maxmem = Math.max(maxmem, totmem);
}