Click here to Skip to main content
12,896,826 members (58,994 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET
i want to get the search result time like google when i'm using Datareader to fetch record from db
can anyone tell me how to do this?
Posted 2-Oct-12 3:21am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

for a very precise indication you can use the Stopwatch class[^]
var sw = new StopWatch();
// Do your sql query
var timeSpent = sw.TotalMilliseconds;
Surendra0x2 2-Oct-12 13:44pm
how to convert
var timeSpent = sw.ElapsedMilliseconds.ToString();
milliseconds to seconds i want to show result in seconds can u help me?
Surendra0x2 2-Oct-12 14:15pm
Thanks Buddy i got the solution :)
Guirec Le Bars 2-Oct-12 22:27pm
I don't know who downvoted the solution to 1 but some explanations would probably make sense :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 2 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100