viernes, 1 de junio de 2012

Cristhian Vergara (Otros)

Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara
Cristhian Vergara

Medir el tiempo de ejecución con la clase StopWatch


Medir el tiempo de ejecución con la clase StopWatch

0 comentarios
La clase StopWatch mide el tiempo transcurrido para un intervalo, o el total de tiempo de varios intervalos. Mediante los métodos Star, Stop y la propiedad Elapsed se determina el valor de tiempo transcurrido. Mas información en MSDN (http://msdn.microsoft.com/es-es/library/system.diagnostics.stopwatch.aspx)
Para este ejemplo, voy a realizar una consulta con ADO.NET y LINQ TO SQL, la idea es medir el tiempo de de acceso a datos. La tabla se llama MODELOAVION la cual contiene 53,330 filas o modelos de aviones.
image
La siguiente interface contiene dos botones; uno para ADO.NET y el otro para LINQ TO SQL, un par de etiquetas para mostrar el tiempo transcurrido y un DataGridView para ver los datos:
image