using System ; using System .Diagnostics; using System .IO; class Program { static void Main() { // // Setup the process with the ProcessStartInfo class. // ProcessStartInfo start = new ProcessStartInfo();
Promise: Promise为了解决异步回调地狱而生的,其解决方法就是链式调用promise.then()或promise.all(); Promise有两个参数,resolve和reject,第一个代表正确的返回处理,第二个代表异常的返回处理! function promise1(){ let num = 0; return new Promise((resolve,reject)=>{ setTimeout(()=>{ num++; resolve(num); },3000); });