long startTime = Environment.TickCount; long endTime = Environment.TickCount; long totalTime = endTime - startTime;