How to know what my ajax script is doing?

How to know what my ajax script is doing?

Hi, the title of my post might be a little confusing but I'll try to explain what I'm trying to do.

I'm using the forms plugin to submit a form with ajax, the server side php script does something like this (using php):

<?php
        $object->function1();
        $object->function2();
        $object->function3();
        $object->function4();
        $object->function5();
?>

Everything works fine but my question is, is there any way I can know what function is currently executing? I'd like to display a message that says something like "Processing (function1)" and changes as the script goes on, but I don't know how to get it :(

Thanks in advance!