- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
如何计算程序运行时间(How do I calculate the program running time)
如何计算程序运行时间(How do I calculate the program running time)
First, dtime and etime: the execution time that has been used
The return values of these two functions are all used times (if -1.0, indicating errors). The time returned is expressed in seconds.
By default, the dtime and etime versions used by Fortran 95 use the systems low precision clock. The accuracy is one percent seconds. However, if you run the program under the Sun OSTM operating system utility ptime (1) (/usr/proc/bin/ptime), a high precision clock is used.
1. dtime: time has been spent since the last call to dtime
For dtime, time has been used as:
?
The first call: since the beginning of execution, the time has been spent
?
Later call: since the last call to dtime, it took time
?
Single processor: CPU takes up time
?
Multiprocessor: the total amount of time taken by all CPU. This data is useless, so you can use etime instead.
--------------------------------------------------------------------------------
Note:
Calling dtime in a parallel loop results in an indeterminate result because all threads participating in the loop share the already used time counter.
--------------------------------------------------------------------------------
The function is called as follows:
E = dtime (tarray)
Tarray
Real (2)
output
E= -1.0: error: tarray value undefined
E and -1.0: there is no error, tarray (1) is stored in the user time, tarray (2) is stored in the system time
Return value
Real
output
E= -1.0: error
E = -1.0:tarray (1) and tarray (2) and
Example: dtime (), single processor:
Demo% cat tdtime.f
Real, e, dtime, t (2)
Print *, elapsed:, e, , user:, t (1), , sys:, t (2)
Do I = 1, 10000
K=k+1
End do
E = dtime (T)
Print *, elapsed:, e, , user:, t (1), , sys:, t (2)
End
Demo% F95 tdtime.f
Demo% a.out
Elapsed:, 0.0E+0, user:, 0.0E+0, sys:, 0.0E+0
Elapsed: 0.03, user: 0.01, sys: 0.02
Demo%
2. etime: since the beginning of execution, the time has been spent
For etime, time has been used as:
?
Single processor exe
您可能关注的文档
- 圆柱的表面积2教时(The surface area of the cylinder is 2 hours).doc
- 圆通祖师行谊记事(Yuantong founder cycico notes).doc
- 土地分等定级与估价(Land gradation and evaluation).doc
- 土壤-植物系统中硒的迁移转化及低硒地区食物链中硒的调节(Migration and transformation of selenium in soil plant system and regulation of selenium in food chain of low selenium area).doc
- 土建与水电全套计算规则(Complete set of calculation rules for civil engineering and hydropower).doc
- 土木工程施工技术习题集(Exercises for civil engineering construction).doc
- 土鳖网站是怎样炼成的(How to make the wood louse website).doc
- 图书管理系统课程设计(带头结点带头指针双向链)(Library management system curriculum design (take the lead, take the lead, pointers, two-way Chain)).doc
- 在vb中制作单独程序封面的两种方法(Two methods of making separate program covers in VB).doc
- 在vc++中使用flash界面(Using the flash interface in vc++).doc
- 如何管理80、90后(How to manage 80, 90).doc
- 如何让员工与公司齐心协力(How can employees and companies work together).doc
- 如何让员工信服(How to convince employees).doc
- 如何让手脚不再冰凉干燥(How to let hands and feet no longer cold and dry).doc
- 如何让管理卓有成效(How to make management effective).doc
- 如何让自己的思维活跃些(How to make your mind active).doc
- 如何编写高效率的易语言程序(How to write efficient language programs).doc
- 如何编写程序代码(How to write program code).doc
- 如何训练观察力(How to train observation).doc
- 如何评价历史人物(How to evaluate historical figures).doc
文档评论(0)