I need to work with times, such as a timer (not my case), which at the end of its execution would have to save its value.
So I thought of some possibilities like:
-
java.utils.Date
: only the data in the case is not a Data; - In
long
: saving the times in milliseconds, and convert it to the required formats whenever necessary; (if I went that way I found these two examples of conversions: this one right here in SOpt , and this ) - Create my own object
Tempo
, which controls over milliseconds as in the previous option;
My question is as follows (Here is my question algorithm):
String pergunta = "Há alguma forma/tipo no Java que seja adequada a esse tipo de informação"
+ ", que não seja uma forma adaptativa como no caso de armazenar em um long?";
boolean resposta = fazerPerguntaComRespotaBoolean(pergunta);
String perguntaSecundaria = null;
if(resposta == true){
perguntaSecundaria = "Qual seria? E como utilizar?";
} else {
perguntaSecundaria = "Qual forma adaptativa é mais 'adaptativa' e esse tipo de dados?";
}
String respotaSecundaria = fazerPerguntaComRespotaDissertativa(perguntaSecundaria);
System.out.println(respotaSecundaria);
If you do not know what to do,