Skip to content

Instantly share code, notes, and snippets.

@VarunBatraIT
Last active May 7, 2018 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VarunBatraIT/75c7535377da9d8373f098d4947f0f8a to your computer and use it in GitHub Desktop.
Save VarunBatraIT/75c7535377da9d8373f098d4947f0f8a to your computer and use it in GitHub Desktop.

Situation

  • We have three files - page.html, sidebard.html, main.html

page.html

  • Head only has jQuery
  • Body has three divs with id timestamp, sidebar and main.

main.html content

<h1>This is main</h1>

sidebar.html content

<h1>This is sidebar</h1>

Assignment

Calculate time for both requests to complete when goes concurrenctly

  • Save the T - where T is document.ready timestamp in milliseconds.
  • Load main.html and sidebar.html using ajax. It should not be one by one - request should go concurrently
  • Note the T+X when both the requests are complete. Display X inside div with id timestamp

Example Support these two requests were started at T and ended at T+200ms then display 200ms once both the requests are completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment