本帖最后由 shrine 于 2020-6-15 07:58 编辑
[Fortran] 纯文本查看 复制代码
program main
Use DFPort
Use Kernel32
integer , parameter :: QP = Selected_real_kind( 18 )
integer::a , b , f,iss
real(kind=QP)::time_begin,time_end
CALL CPU_TIME ( time_begin )
iss = QueryPerformanceFrequency( Loc(f) )
iss = QueryPerformanceCounter( Loc(a) )
......
......!computing
.....
iss = QueryPerformanceCounter( Loc(b) )
CALL CPU_TIME ( time_end )
write(*,*)'Time of operation was ',(b-a)*1.0e-8_QP/(f*1.0e-8_QP), ' seconds' ,time_end-time_begin
end
这两种方法本身相差0.2秒
连续两次计算,相同的方法居然相差0.5秒,这也太多了吧
|