zoukankan      html  css  js  c++  java
  • fortran中如何提供计算程序运行时间?

    如下:

    Real time_begin , time_end1 , time_end2
    Integer i , j
    call CPU_TIME(time_begin)
    write(*,*) time_begin
    do j = 1 , 30  
    Do i = 1 , 300000000
    End Do  
    call CPU_TIME(time_end1)  
    write(*,*) j , time_end1 ,  time_end1 - time_begin
    end do
    call CPU_TIME(time_end2)
    write(*,*) 't' , time_end2 , time_end2 - time_beginend

    输出为:

      1.5600100E-02
               1   1.248008       1.232408
               2   2.496016       2.480416
               3   3.697224       3.681623
               4   4.914032       4.898431
               5   6.099639       6.084039
               6   7.316447       7.300847
               7   8.517654       8.502054
               8   9.734463       9.718863
               9   10.92007       10.90447
              10   12.13688       12.12128
              11   13.33809       13.32248
              12   14.53929       14.52369
              13   15.74050       15.72490
              14   16.97291       16.95731
              15   18.18972       18.17412
              16   19.39092       19.37532
              17   20.59213       20.57653
              18   21.77774       21.76214
              19   22.96335       22.94775
              20   24.19576       24.18015
              21   25.39696       25.38136
              22   26.59817       26.58257
              23   27.81498       27.79938
              24   29.01619       29.00059
              25   30.21739       30.20179
              26   31.43420       31.41860
              27   32.65101       32.63541
              28   33.83662       33.82102
              29   35.02222       35.00663
              30   36.22343       36.20783
    t   36.22343       36.20783
    请按任意键继续. . .

  • 相关阅读:
    李开复给中国学生的第二封信:从优秀到卓越
    李开复写给中国学生的一封信:从诚信谈起
    Cocos2D-x培训课程
    CCLabelAtlas创建自定义字体
    cocos2d-x设计模式发掘之五:防御式编程模式
    【转】VS2010中使用AnkhSvn
    cocos2d-x 2.1.4学习笔记01:windows平台搭建cocos2d-x开发环境
    【转】Win7环境下VS2010配置Cocos2d-x-2.1.4最新版本的开发环境(亲测)
    ffmpeg开发中出现的问题(二)
    ffmpeg开发中出现的问题
  • 原文地址:https://www.cnblogs.com/China3S/p/3500602.html
Copyright © 2011-2022 走看看