执行查询时显示时间 [英] Display time when executing query

查看:86
本文介绍了执行查询时显示时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在运行asp.net运行查询期间显示标签上的持续时间?



我尝试过:



我创建了2个计时器。一个(Timer1)更新标签上的时间,其他(Timer2)执行存储过程。但是当启用定时器2时,Timer1不会运行并更新标签上的时间。

how can I display the time duration on a label during running query for asp.net?

What I have tried:

I created 2 timers. One (Timer1) updates the time on a label, other (Timer2) executes stored procedure. But when timer 2 is enabled, Timer1 doesn't run and update the time on the label.

推荐答案

使用Stopwatch [ ^ ]类。在SP之前开始计时并在之后停止计时,然后在标签中显示持续时间的结果。
Use the Stopwatch[^] class. Start timing before the SP and stop timing after, then show the results of the duration in your label.


这篇关于执行查询时显示时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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