function fetchUrl (url) {
  let promise = new Promise((resolve, reject) => {
    let client = new XMLHttpRequest();
    client.open("GET", url);
    client.onreadystatechange = () => {
      if (client.readyState !== 4)
        return;
      if (client.status === 200)
        resolve(client.responseText);
      else
        reject(client);
    };
    client.send();
  });

  return promise;
}

if (process.argv.length < 2) {
  console.log(`usage:  ${process.argv[0]} $url`);
  process.exit(-1);
}
let url_to_fetch = process.argv[1];

fetchUrl(url_to_fetch).then((data) => {
  console.log(data);
}).catch((err) => {
  console.log(`error fetching ${url_to_fetch}`);
  console.log(err);
});

@@ -529,16 +529,43 @@
 gv%5B1%5D;%0A%0A
+console.time(%22fetch url%22);%0A
 fetchUrl
@@ -617,16 +617,48 @@
 (data);%0A
+  console.timeEnd(%22fetch url%22);%0A
 %7D).catch
@@ -718,16 +718,16 @@
 tch%7D%60);%0A
-
   consol
@@ -738,12 +738,44 @@
 g(err);%0A
+  console.timeEnd(%22fetch url%22);%0A
 %7D);%0A

add a timer