How to test CPU speed?

Hi guys,
long time no see :stuck_out_tongue:

I was wondering if anyone has an idea how to test CPU speed of userā€™s system to determine the optimal performance. Iā€™m wringing some classes atm, and the movies I create will be very demanding (high res, lots of moving/changing shapes, blending modes, video etc.) I wanted to somehow check userā€™s system and based on itā€™s performance I could turn off some layers, ā€˜normalizeā€™ some blend modes, opacity and things like thatā€¦ I will probably make AIR application at some point, since browser plug-in really choaks CPU, but thatā€™s another story ((:

Sasxa

CTRL+ALT+DELETE, task manager, and click on the performance tab is a pretty basic way of doing this.

I need some method for detecting ā€œuserā€™s systemā€, not mine (:

Oh haha. I thought my solution may have been too obvious to be useful! No idea then, sorry. I need to learn to read better. :slight_smile:

Iā€™d suggest reading up on the flash.system package as it has alot of methods that allow you to get quite a bit of information about the userā€™s CPU. The flash.system.Capabilities class is probably more the direction youā€™ll be taking as it has some of the following methods that can really be a good base to figuring out if the userā€™s system is able to handle some of what you want to dish out.

For example:
flash.system.Capabilities.os will return the operating system

flash.system.Capabilities.screenResolutionX/flash.system.Capabilities.screenResolutionY will return the resolution

flash.system.Capabilities.hasEmbeddedVideo will more than likely tell you if the personā€™s computer can even play video (although I havenā€™t used/tested this with a computer that doesnā€™t have that capability so Iā€™m assuming a little bit here)

It unfortunately doesnā€™t have specific tidbits such as exact CPU speed (as far as I know) but having the rest of the info accessible to you regarding the system may help you find out more. Kind of like the Pythagorean theorem, heh. For more detailed information on the rest of the methods, classes in the package, etc take a look here:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/system/package-detail.html

Hopefully that helps out a bit.

you could always do a crude benchmarkā€¦
something like:

var t:uint = getTimer();

var n:Number = 1;
for(var i:int=0; i<1000000; i++){
n = n*1.0000001;
}

var cpuTime:uint = getTimer()-t;

if(cpuTime < XX){
trace("cpu is fast);
}else{
trace("cpu is slow);
}

cool, tnx guys. Iā€™ll try some of your suggestions. BTW, is there a property that will return Real FPS value? I guess that would be the best criteriaā€¦

This blog post has a very good solution to finding the real framerate.

http://blog.efnx.com/?tag=stageframerate

edit: Wiinner! lol @ juggler

http://blog.efnx.com/?p=13 That might help. Otherwise just google ā€œAS3 frames per secondā€.

edit: Beated!