private String chooseResolution(double time) {
    if (time < 180) // 3 minutes
      return "secs";
    time /= 60; // minutes
    if (time < 180) // 3 hours
      return "minutes";
    time /= 60; // hours
    if (time < 72) // 3 days
      return "hours";
    time /= 24; // days
    if (time < 90) // 3 months
      return "days";
    time /= 30; // months
    if (time < 36) // 3 years
      return "months";
    return "years";
  }
private String chooseResolution(double time) {
    if (time < 180) 
      return "secs";
    time /= 60; 
    if (time < 180) 
      return "minutes";
    time /= 60; 
    if (time < 72) 
      return "hours";
    time /= 24; 
    if (time < 90) 
      return "days";
    time /= 30; 
    if (time < 36) 
      return "months";
    return "years";
  }
private String chooseResolution ( double time ) { if ( time < 180 ) // 3 minutes return "secs" ; time /= 60 ; // minutes if ( time < 180 ) // 3 hours return "minutes" ; time /= 60 ; // hours if ( time < 72 ) // 3 days return "hours" ; time /= 24 ; // days if ( time < 90 ) // 3 months return "days" ; time /= 30 ; // months if ( time < 36 ) // 3 years return "months" ; return "years" ; }
choose a resolution based on # seconds
choose a resolution based on # seconds