Last active
          April 29, 2018 11:50 
        
      - 
      
 - 
        
Save AshanthaLahiru/0b2e9a374bcef53b41b22543ac3b2475 to your computer and use it in GitHub Desktop.  
    Performance of promise
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | promise(1000) // |-----| | |
| .then(msg => { | |
| console.log(msg) | |
| }) | |
| promise(2000) // |-----|-----| | |
| .then(msg => { | |
| console.log(msg) | |
| }) | |
| promise(3000) // |-----|-----|-----| | |
| .then(msg => { | |
| console.log(msg) | |
| }) | |
| // Result | |
| /* | |
| Promise 1000 start | |
| Promise 2000 start | |
| Promise 3000 start | |
| Promise 1000 end | |
| Promise 2000 end | |
| Promise 3000 end | |
| */ | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment