Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is inside Callback queue (debugger)?

Tags:

javascript

I would like to know how is it possible to know the content of the callback queue.
For example, if you consider the following Javascript code :

<script>
    console.clear();   
    setTimeout( function () {console.log("Hello ")},5000);      
    console.log("What is inside Callback Queue ? ");        
</script> 

Is there a mean to print the content of the callback queue to the console ?
If not possible in such that way, is it possible with a debugger by adding a break point to the line console.log("What is inside ...?"); (I tried with Firefox debugger but I did not manage to do it)
Or another solution ? Thanks for answer.

like image 530
Stef1611 Avatar asked Sep 27 '26 13:09

Stef1611


1 Answers

The performance tab of the browser's developer tools contains all the informations needed. Do the following:

  1. Filter markers : function call (only to avoid a lot of informations)

  2. Start Recording

  3. Reload (CTRL + R)

  4. Stop Recording (With my example, when Hello is printed to the console)

In the waterfall, Click on the mark that appears after 5000ms (with my example) and useful informations are displayed in the right pane.

like image 179
Stef1611 Avatar answered Sep 30 '26 03:09

Stef1611



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!