Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8558069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:43:25+00:00 2026-06-11T15:43:25+00:00

or ecmascript but i wonder if how it actually happens depends more on the

  • 0

or ecmascript but i wonder if how it actually happens depends more on the exact implimentation.

javascript is technically single threaded.

but if i do something like

$myDIv.animate({
    height:"100px"
});

does it make any difference if i do

A.

$myDIv.animate({
    height:"100px"
}, null, my_cpu_heavy_function);

or B.

$myDIv.animate({
    height:"100px"
});
my_cpu_heavy_function();

because in the second one the animation would be fighting for processing time with the cpu heavy function and so the look of the animation would suffer, right?

So does Javascript stop executing at the end of a synchronous block of code or does it cut off one block at any random point to allow another block running asynchronously to be processed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:43:26+00:00Added an answer on June 11, 2026 at 3:43 pm

    does it make any difference if i do A or B

    Yes it will make a difference.

    The second version doesn’t so much fight for processing time. It’s more like the my_cpu_heavy_function will occupy all processing time once it begins, assuming it is synchronous.

    In other words, once a bit of synchronous code begins, it does not end until complete, irrespective of any timed asynchronous code that may be scheduled to run. The async code will always be forced to wait for the synchronous code to complete.

    So what will happen will be that the animation will begin, and perform its initialization, but then the my_cpu_heavy_function will immediately start, and block the rest of the animation until it is complete.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if is better to use application/javascript or application/ecmascript and
I'm working on some ECMAScript/JavaScript for an SVG file and need to get the
Hey all, let's jump straight to a code sample to show how ECMAScript/JavaScript/AS3 can't
This is a basic question about the JavaScript (ECMAScript) language so I apologize in
I'm trying to find a good EBNF description of ECMAScript, but so far I've
Is anyone aware of a definitive list of areas of missing support for ECMAScript/JavaScript
I'm 99.9% positive that this isn't possible, but there may be some obscure ecmascript
I'm trying to get used to the real prototypal inheritance of JavaScript (ECMAScript 5)
ECMAScript 5 has the filter() prototype for Array types, but not Object types, if
I want to build a library in JavaScript/JScript/ECMAScript...whatever you want to call it, which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.