如何得到应用程序的运行时间
来源:互联网 发布:浙江省网络图书馆 编辑:程序博客网 时间:2024/04/30 05:53
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
利用函数GetTickCount就可以搞定,不过他是个API,需要声明一下下。
还有需要注意的是,这个函数返回的是毫秒,所以需要自己再转换单位的!
GetTickCount得到的是操作系统到现在为止的运行时间,那么用两次的返回值相减就可以了。
Option Explicit
Private Declare Function GetTickCount Lib "kernel32" () As Long
Dim a As Long
Private Sub Command1_Click()
MsgBox (GetTickCount - a) '应用程序的运行时间
End Sub
Private Sub Form_Load()
a = GetTickCount
End Sub
由于GetTickCount返回的值是DWORD类型。因此,操作系统再运行了49.7天后,这个值就会归0。
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- 如何得到应用程序的运行时间
- 如何得到应用程序的运行时间
- 得到c++的运行时间
- vc++ 如何得到程序运行时间
- 得到指定进程的运行时间
- 【转】 得到指定进程的运行时间
- 如何得到黑莓手机的system uptime,也就是不间断运行时间
- Matlab得到运行时间
- 紧急求助国内外大侠:如何编写程序得到正在运行的ppt的当前页码和运行时间?
- 如何得到jar包的运行路径?
- 如何得到系统的时间 CTime
- 如何得到系统时间
- PEAR得到程序运行时间
- javascript如何得到当前时间之后的时间值
- 如何在VC6.0中得到一个程序的运行时间,也就是这个程序耗费的时钟周期数// C和C++的时间编程
- Java是如何运行应用程序的
- 如何得到当前时间日期
- 如何得到服务器当前时间
- J2ME中使用Socket开发联网程序
- JDBC-ODBC桥
- FLASH工具的秘密——SWF2EXE
- 高级的TreeView控件
- J2ME 2D小游戏入门之实现爆炸
- 如何得到应用程序的运行时间
- Hibernate下数据批量处理解决方案
- 处理鼠标移出事件
- 深入理解MIDP低层用户界面API
- 让Real Player从你的电脑走开
- 10分钟Hibernate体验
- MCI Command String全览——完全参数篇(1)
- SunONE Studio5开发MIDP程序
- MCI Command String总览—完全参数篇(6)