views:

215

answers:

4

Couldn`t find any ActionScript native APIs even in the beta documentation, am I right supposing that this means the only way to measure CPU / memory consumption is by cooking up a custom native solution, hooking it up with AIR and making it work on each targeted platform?

Basically the aim is to be able to have this information available inside AIR and not having to use an external application for profiling, not even Flex / Flash builder.


Thanks for the helpful answers, System.totalMemory sneakily eluded me!

Seems for the CPU load the only solution will be some command line scraping using NativeProcess.

+2  A: 

you can measure the memory consumption like this:

System.totalMemory

if you google for "as3 fps" you will find a lot of sites discussing how to measure the actual framerate.

but i don't think you can find out the cpu consumption of your flash app without outside help.

maxmc
do note that this is the total memory of *all* flash apps running (air excluded) so if you have multiple instances of your app running or even just youtube up in the background, that'll be included.
grapefrukt
+1  A: 

You might want to give this AIR based debugger a try, it's really pretty good:

http://www.monsterdebugger.com/

debu
A: 

Alcon is another debugger which offers real-time memory profiling.

Thomas
+1  A: 

Actually you can access the same API used by the Flex Builder profiler, if you don't want to pay for Flex Builder. It's not documented very well, so it would probably take a lot of work, but it's here for those that are interested:

flash.sampler package detail

davr