与asp.net相关的问题....... [英] Problem Related to asp.net.......

查看:55
本文介绍了与asp.net相关的问题.......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用Datareader从数据库中获取记录时,我想获得类似于Google的搜索结果时间
谁能告诉我该怎么做?

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?

推荐答案

有关非常精确的指示,您可以使用Stopwatch类
http://msdn.microsoft.com/zh-CN /library/system.diagnostics.stopwatch(v=vs.80).aspx [
for a very precise indication you can use the Stopwatch class
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch(v=vs.80).aspx[^]
var sw = new StopWatch();
sw.Start();

// Do your sql query

sw.Stop();

var timeSpent = sw.TotalMilliseconds;


这篇关于与asp.net相关的问题.......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆