function outOfTime() {
  var stopLayout = new Layout( {
  type:"v", c: [
    {type:"txt", font:"30%", label:"Done!", id:"time" },
  ]
  }, {btns: [
    // menu button allows user to modify times and sets
    {label:"Menu", cb: l=> {
        if (outOfTimeTimeout){
          clearTimeout(outOfTimeTimeout);
          outOfTimeTimeout = undefined;
        }
        //stopLayout.remove();
        setup();
      }
    },
    // restart button runs timer again with the same settings
    {label:"Restart", cb: l=> {
      if (outOfTimeTimeout){
        clearTimeout(outOfTimeTimeout);
        outOfTimeTimeout = undefined;
      }
      //stopLayout.remove();
      timerMode = 'active';
      startTimer();
    }
  }
  ]});

  if (counterInterval) return;
  setsRemaining = numSets;
  g.clear();
  stopLayout.render();
  Bangle.buzz(500);
  Bangle.beep(200, 4000)
    .then(() => new Promise(resolve => setTimeout(resolve,200)))
    .then(() => Bangle.beep(200, 3000));
}
/** Display 'Done' view, called when all sets are completed */
Display 'Done' view, called when all sets are completed
Display ' Done ' view called when all sets are completed
function outOfTime() {
  var stopLayout = new Layout( {
  type:"v", c: [
    {type:"txt", font:"30%", label:"Done!", id:"time" },
  ]
  }, {btns: [
    {label:"Menu", cb: l=> {
        if (outOfTimeTimeout){
          clearTimeout(outOfTimeTimeout);
          outOfTimeTimeout = undefined;
        }
        setup();
      }
    },
    {label:"Restart", cb: l=> {
      if (outOfTimeTimeout){
        clearTimeout(outOfTimeTimeout);
        outOfTimeTimeout = undefined;
      }
      timerMode = 'active';
      startTimer();
    }
  }
  ]});
  if (counterInterval) return;
  setsRemaining = numSets;
  g.clear();
  stopLayout.render();
  Bangle.buzz(500);
  Bangle.beep(200, 4000)
    .then(() => new Promise(resolve => setTimeout(resolve,200)))
    .then(() => Bangle.beep(200, 3000));
}
function outOfTime ( ) { var stopLayout = new Layout ( { type : "v" , c : [ { type : "txt" , font : "30%" , label : "Done!" , id : "time" } , ] } , { btns : [ { label : "Menu" , cb : l => { if ( outOfTimeTimeout ) { clearTimeout ( outOfTimeTimeout ) ; outOfTimeTimeout = undefined ; } setup ( ) ; } } , { label : "Restart" , cb : l => { if ( outOfTimeTimeout ) { clearTimeout ( outOfTimeTimeout ) ; outOfTimeTimeout = undefined ; } timerMode = 'active' ; startTimer ( ) ; } } ] } ) ; if ( counterInterval ) return ; setsRemaining = numSets ; g . clear ( ) ; stopLayout . render ( ) ; Bangle . buzz ( 500 ) ; Bangle . beep ( 200 , 4000 ) . then ( ( ) => new Promise ( resolve => setTimeout ( resolve , 200 ) ) ) . then ( ( ) => Bangle . beep ( 200 , 3000 ) ) ; }
Display 'Done' view, called when all sets are completed
Display ' Done ' view called when all sets are completed
// menu button allows user to modify times and sets //stopLayout.remove(); // restart button runs timer again with the same settings //stopLayout.remove();