main()
{
clock_t start, end;
double elapsed;
start = clock();
/* some function */
end = clock();
elapsed = ((double) (end - start)) / CLOCKS_PER_SEC;
}
I have no knowledge of VB.NET, and I need the preceding C program in VB.NET. I’d also like the elapsed time to show the number of days when the elapsed time exceeds 24 hours.
You may use the
System.Diagnostics.Stopwatchclass to time operations precisely in .NET.The elapsed
TimeSpanmay now be retrieved asstopwatch.Elapsed. For a direct analogue to your C code, you would write: