FPS Slowing Over Time

After noticing a gradual increase in lag in a game I’m writing,
I started a brand new project and wrote this simple counter
to test if it would slow down eventually as well. Unfortunately,
once the count reaches about 20,000 , there is a noticeable decrease
in FPS. What’s going on?


var count:int = 0;

stage.addEventListener(Event.ENTER_FRAME, mainLoop);
function mainLoop(e:Event):void {
    count++;
    Count.text = String(count);
    
}