Skip to content

Instantly share code, notes, and snippets.

@renatogroffe
Created June 3, 2024 16:44
Show Gist options
  • Save renatogroffe/100f733329525862781e54f63ccedbd3 to your computer and use it in GitHub Desktop.
Save renatogroffe/100f733329525862781e54f63ccedbd3 to your computer and use it in GitHub Desktop.
string[] amostrasTempo = ["71.715", "71.716", "71.829", "71.830", "71.832"];
foreach (var amostra in amostrasTempo)
{
Console.WriteLine();
var amostraSegundos = JsonSerializer.Deserialize<double>(amostra);
Console.WriteLine($"Tempo em segundos = {amostra}");
Console.WriteLine($"Tempo em segundos (double) = {amostraSegundos}");
var amostraTimeSpan = TimeSpan.FromSeconds(value: amostraSegundos);
Console.WriteLine($"Tempo em segundos (TimeSpan) = {amostraTimeSpan} | TimeSpan.FromSeconds(value)");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment