说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

计算从开机到现在用了多少秒-VB资料

HTML文档下载 WORD文档下载 PDF文档下载
计算从开机到现在用了多少秒-VB资料

下面的程序与标准的Timer控件相比,有两个同的地方:

1。该程序计算的起点是系统启动的时间,而不是从午夜开始算起。如果你想从午夜开始算起,用(Now-Int(Now))*86400这条语句就行了。

2。精度更高,标准Timer控件的Tick频率为1KHz,而该程序为1.4MHz

下面是程序的源代码:

Option Explicit

Private Declare Function osQueryPerformanceCounter Lib "Kernel32" Alias "QueryPerformanceCounter" _ (lpPerformanceCount As Currency) As Long

Private Declare Function osQueryPerformanceFrequency Lib "Kernel32" Alias "QueryPerformanceFrequency" (lpFrequency As Currency) As Long

Public Function Timer() As Single

Dim freq As Currency, count As Currency

osQueryPerformanceFrequency freq

osQueryPerformanceCounter count

Timer = count / freq

End Function

需要说明的一点是,如果你查阅API手册,你会发现API并不能识别Currency数据类型。在API手册中,osQueryPerformanceFrequencey要求的参数是一个Large_Integer的数据结构,该数据结构由两个Long类型的数据组成。Currency实际上也是按同样的方法来储存的。只不过在计算时被除以10000。因此你也可以写成:, (freq/10000) / (count/10000) = freq/count。关于上面的两个API函数,osQueryPerformanceFrequecy表示一秒内,计时器Tick了多少次;osQueryPerformanceCounter表示从开机到现在,计时器一共Tick了多少次。二者相除,就是从开机到现在过去了多少秒钟。
2014腾讯WE大会:开启未来的五大科技发展趋势 TIOBE 2014年11月编程语言排行榜:R受大数据影响跃至12位 深圳微信开发者大会全部议程出炉 最后仅剩30个参会名额 智能硬件:一半海水,一半火焰 聚焦SDN、NFV、云安全基础架构等技术热点 2014云安全联盟高峰论坛即将召开 富Web应用开发的七大原则 应用原型设计毫无压力!开源Sketch插件管理器Sketch Toolbox 【MDCC专访】友盟副总裁焦岳:从36万款App,看今年的热门领域 一切只为经典 微信开发者大会前瞻(附议程) 从手势识别到增强现实,开发实感应用该了解的技术细节 福利来了,爱拍原创免费为iOS版手游制作宣传视频 【工具推荐】Zrender——轻量级Canvas类库,让绘图大不同! 基于Docker和CoreOS的开源PaaS平台——Deis v1.0正式发布! 微软宣布.NET开发环境开源 支持三大操作系统 爆发吧,诺基亚!前员工开发物联网新设备 详解Visual Studio Emulator for Android,微软的Mobile First! HPC China 2014完美落幕,AMD Firepro荣获好评! 揭秘微软的Container技术之一Drawbridge AWS副总裁谈数据中心网络打造 【最具价值CTO评选秀】出门问问CTO雷欣:从技术极客到核心管理的秘密 《近匠》APICloud:“云”+“端”一体的移动API提供者 Oculus移动SDK发布!John Carmack操刀、集成Unity 4.5 11月15日深圳见!深圳微信开发者大会公布全部议程 参与2014中国大数据行业大调查 BDTC门票等你拿 HTML5规范尘埃落定,5个开发工具推荐 盘点最受开发者喜爱的Android 5.0 Lollipop API IoE Day侧记:想开发智能硬件?先要弄明白这几个问题 【问底】许鹏:使用Spark+Cassandra打造高性能数据分析平台(二) 微软承诺所有Lumia WP8设备将升级至Win10,用户会买账吗? 周末,深圳微信开发者大会等您来!(参会必读+名单) 营造云安全生态链 第五届云安全联盟高峰论坛在京顺利召开 创建数据库的问题,50分大派送。 各位大虾,请指教有关winsock api中的bind() 算法求教!一个逻辑表达式。(只带有and和or还有左右括号,括号可以嵌套。如果判断逻辑表达式的格式是否正确? ) SUIPack的注册码? 高分求VSS(版本控制)的使用方法文挡 (中文版)!!!!!!! *********远程备份*********** 为什么我的程序在别的机器上不能运行? 如何判断某窗口类已经有一个实例存在? 如何在C++中访问这些寄存器 ohttpd的问题~~~~~ 金山词霸是如何嵌入的? 鼠标右键失灵 关于msxmlsdk4.0! 急救!急救!急救!急救!急救!急救! 100分求一个项目开发总结报告的一个示例,多谢! 这是什么错误,大家请进? 我安装7.1时候选择了chinese(tw)语言,但是安装好后还是英文界面? 急寻深圳FDF高手,JSP(懂LINX)高手! 为什么我的SQLServer2000(企业版正版)不时出现坏表? ACM音频压缩 bcb6 控件的下载及应用 求救!!我用VB写的windows服务为什么不能运行?快来看看 这个文本文件的数据如何才能传送到数据库表中? 奇怪的现象,Crystal Report 8.5设计器中图表无法显示中文? 各位,谁有比较完整清晰的C#(Asp.net)编码规范,可否给小弟一份,谢谢。赠送100分。 關于 線程內使用數據庫的問題 Unix的文件名字符长度能否超过14个?为什么? 类初始化的问题。求教 数据窗口倒出存为excel格式时,如何倒出表头 请高手指教!!! 如何使用DLL(在线等待) 终于配置成功了jboss应用服务器 动态报表设计 备份日志语句! 98的MSDOS程序都不能运行了,说与系统连接的设备不能运行了,怎么解决?急!!! 问个色彩寄存器的问题 关于WINDOWS服务定时运行的问题,求救!!!!。。 加急!如何只将文档发送给[代办事宜]中,而在邮件数据库中不留痕迹? initialize the Borland Database Engine (error $2501) 带小数点的数字用什么变量类型? 谁用过DHTMLEDIT控件?帮帮忙介绍一下用法。 该死的ACCESS 怎样编写服务器接受客户端的相应程序 我的机子安装完WIN2000后,访问其它的计算机就死机,别的机子访问我机子的时候,我的机子也会死机。 怎样合并两个表??????? 一个有关ISampleGrabber接口调用的问题!Please HELP ME... 如何访问客户端指定路径上的ACCESS数据库? 可以远程安装win2k服务器版么?(各位帮忙!) 还有1。2的考试吗 一条sql语句! 我能在w2k下为非PnP串口设备写驱动吗? 哪位可以解释一下,构造函数到底有什么作用??? Dinosaurs existed ______a long time ago.A.in world B.in Earth C .on Earth D.in land选什么?为什么? i like the moon-cakes with nuts in them b____根据首字母填单词 英语翻译 is it?It's spring. I don't like cakes w meat i them如题 W I 后面填什么? 英语翻译By the 1970,darp,the pentagon is research arm,began working on a computer network,which soon spawned a new form of communication:electronic mainl.抱歉,上面句子中,时间后面的“darp”错了,应该是darpa Jenny,can you come ——to my home for dinner tomorrow?横线上填back还是over? 用英语解释DInosaurs existed on Earth millions of year ago how far do you agree with Jefferson that only a nation of educated people could remain free?lessons from jefferson There are eight parts in _ unit in our English book.A.a B.an C.the D.\ 翻译一下DANA的out of sight,out of mind的歌词歌词见http://zhidao.baidu.com/question/26615730.html?si=1 the do you what on weekend do usually这几个单词组成句子还有you much am than i taller 和visit im tomorrow my going grandparents to Robtert,come back to your office.Mr Wang wants to see you.为什么用come Out of sight,out of mind.怎么读 This book is on the desk不加is There are many trees and flowers _____ our classroom.A.in the front of B.in front of C.at the front of D.at the back of还有道:3.Please listen to the teacher carefully.Don't_____the window.A.look to B.look out of C.look into D.look at1.Shall we t more and more young people communicate _sending e-mails .A:by B:with 英语翻译frozen I don't know when he _(come)back.快 a long time ago,two friends lived in a palace and worked for the king.one of these boys _1_ a girl very much and he wanted to give her a present.one afternoon,he and his friend _2_a big vase with some beautiful flowers in it.he _3_up and took one for The friendship that can end was never real China is a great country with 56 peoples ------ is the nationlityA the largest population of it B the largest population of which 为什么不选A呀 many years ago ,Mr.turner ___in Paris with his friends for a long time.A had lived B lives C lived D has lived 为什么不能用过去完成时A Could that be one of the dishes?分析此句的语法结构 China is a great country with 56 peoples,___is the HansA.the largest population of it.B.the largest population of which.请问选哪一个 选b 我知道是定语从句 但a呢?理解成两个句子可以吗? 英语翻译试着掩饰自己的困恼会使事情变糟.Trying__________________makes them worse.Last Sunday I watched my son _____(play)football with his classmates. loser可以变winner这句出自首歌? There are 56__in China .A、people B、peoples C、the people D、people's填空 详解 谢谢 You can see is your so hard to create a happy,very happy for you guys,I know that MJ will be happ Winner Or Loser 英语作文.要3篇,不用太长好的话会提高悬赏 Where is your pen pal from?的回答 英语翻译1..They introduced their goods by ---------(advertise) on TV.2..The little baby should -------- (take) good care of.3.Mike -------- (host) a charity show in the hall at the moment.4..The curtain -------- (rise) and the host came out onto 英语作文:An English Speech Contest写得好有赏哦~~ Where is your pen pal from?他的同义句 They need more sleep 同义句 They need ________ _______ ________. 急 american Labor Day 全文翻译 where is your pen pal from?的同义句是什么啊 The children had an argument( ) what game to play.A.over B.at C.for D.against这是为什么? i be there for you找英文歌歌词里面有i be there for you好像还有when i looking to the feature maybe always see is 歌曲是那种爱情风格的,不怎么激动的,百度上有很多,但是都不是,谁能帮我找找 Where's your pen pal from? nurse essay about children playdiscuss the role of play when caring for children and the ways in which play can help children cope with hospitalization. a solar day is the length of time____the Earth to revolve once around the Sun.A it takes B which takes1 此句话中不可以用which吗?2 选择A是不是中间省略了that?不然不是有2个谓语吗is 和 takes?3 the length of time如何翻译? 谁知到spring retainer中文翻译是什么意思? TokioHotel的歌词+中文翻译 英语翻译这首歌的歌词歌手:ABBA I don't wanna talkAbout the things we've gone throughThough it's hurting meNow it's historyI've played all my cardsAnd that's what you've done tooNothing more to sayNo more ace to playThe winner takes it al I will come back when it is five.(保持句意不变) I -------- come back---------five o'clock TokioHotel,歌词+中文翻译 谁帮我翻译一下the winner takes it all 歌词 It's warm spring的翻译 i think something that you should know is that xiao ming have been there and gone.ps.这里用了两个that 对么? the winner takes it all 是那个电影的曲子?把电影详细介绍一下~~很喜欢这首歌.碰巧听到的 it's spring是什么意思 英语翻译毕竟是歌曲,希望能有带感情的翻译,而不只是软件翻译那种没感情的东西.Sometimes I try sometimes I don’t Sometimes the way I feel inside is gonna show You know we’re all the same I know you’re tired you try 张靓颖《胜者为王》《The Winner Takes It All》中文歌词 It 's spring.It 's( )and( ).I wear( )填入适当的词 COME AGAIN IN SPRING怎么样 the winner takes it all 胜者为王--------这里的the是什么用法? 英语翻译It is China's Spring Festival,Since it was not easy for us to visit my family they came to see us.WuXi is very happy.WuXimay be able to go to kindergarten here in March.WuXi is talking more,she took a shopping bag and said ,’I’m going Your sister dou't like moon cakes with eggs in them有什么错误 内边框怎么翻译
备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn 说三道四技术文摘