Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (var i = 0; i < 4; i++) {
- document.write('<div onClick="console.log(i)">i</div>');
- }
- --------------------------------------------------------------------------------
- var start = new Date();
- function a1000() {
- console.log('a', (new Date()) - start);
- // 1000ms sync process
- console.log('a', (new Date()) - start);
- }
- function b2000() {
- console.log('b', (new Date()) - start);
- // 2000ms sync process
- console.log('b', (new Date()) - start);
- }
- function c3000() {
- console.log('c', (new Date()) - start);
- // 3000ms sync process
- console.log('c', (new Date()) - start);
- }
- function d4000() {
- console.log('d', (new Date()) - start);
- // 4000ms sync process
- console.log('d', (new Date()) - start);
- }
- setTimeout(a1000, 6500);
- setTimeout(b2000, 1000);
- setTimeout(c3000, 6500);
- setTimeout(d4000, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement