function doPromiseTask(){
var promise=new Promise(function(resolve){
setTimeout(function(){
console.log("Timeout Finished and recolve promise 1");
resolve();
},3000);
});
return promise;
}
function doPromiseTask2(){
var promise=new Promise(function(resolve){
setTimeout(function(){
console.log("Timeout Finished and recolve promise 2");
resolve();
},3000);
});
return promise;
}
async function callAwaitFunctions(){
console.log("callPromise1Await Start");
await this.doPromiseTask().then(function(res){
console.log("Start calcutte after resove");
// sleep(100);
console.log("Start calcutte after resov--finished"+sum);
this.doPromiseTask2().then(function(res){
console.log("1235546");
});
// setTimeout(function(){
// console.log("callPromise1Await Finished");
// },3000);
});
console.log("callPromise1Await End");
}
function sleep(delay) {
var start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
console.log((new Date()).getTime() - start );
continue;
}
}
callAwaitFunctions();
console