Actionscripts

How can I trace Fps for the movie with actionscript?
How can I trace Cpu for the movie with actionscript?

I have seen this in other flash movies/games and wonder
how it is done…