JavaScript memory and time profiling

function some_thing() {
  performance.now();
  console.profileStart();
  do_thing();
  console.profileEnd();
  console.log( performance.now() );
}