using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
// obtenemos la hora inicial
DateTime start = DateTime.Now;
// cualquier proceso...
System.Threading.Thread.Sleep(5000);
// obtenemos la hora final
DateTime end = DateTime.Now;
// mostramos la diferencia
TimeSpan total = new TimeSpan(end.Ticks - start.Ticks);
Console.WriteLine(total.TotalSeconds.ToString("0.00") + " seconds");
}
}
}
Comentarios sobre la versión: 1.0 (0)
No hay comentarios