fortran时间函数获得的数据的单位是什么?例如cpu_time,date_and_time,system_clock
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/10/06 09:48:09
fortran时间函数获得的数据的单位是什么?例如cpu_time,date_and_time,system_clock 得到的数的单位是什么
cpu_time返回的是一个浮点型,表示当前CPU运行时间(以秒计)
示例:
program test_cpu_time
real ::start,finish
call cpu_time(start)
!put code to test here
call cpu_time(finish)
print '("Time = ",f6.3," seconds.")',finish-start
end program test_cpu_time
date_and_time稍微复杂,但包括很多信息,包括日期,时间,时区,最后一个参数是一个大小为8的整型数组,记录了年,月,日,时区差(以分钟计),小时,分钟,秒,毫秒.
program test_time_and_date
character(8) ::date
character(10) ::time
character(5) ::zone
integer,dimension(8) ::values
!using keyword arguments
call date_and_time(date,time,zone,values)
call date_and_time(DATE=date,ZONE=zone)
call date_and_time(TIME=time)
call date_and_time(VALUES=values)
print '(a,2x,a,2x,a)',date,time,zone
print '(8i5))',values
end program test_time_and_date
system_clock用于决定处理器时钟周期.count_rate用于决定每秒CPU的时钟计数,
PROGRAM test_system_clock
INTEGER ::count,count_rate,count_max
CALL SYSTEM_CLOCK(count,count_rate,count_max)
WRITE(*,*) count,count_rate,count_max
END PROGRAM
示例:
program test_cpu_time
real ::start,finish
call cpu_time(start)
!put code to test here
call cpu_time(finish)
print '("Time = ",f6.3," seconds.")',finish-start
end program test_cpu_time
date_and_time稍微复杂,但包括很多信息,包括日期,时间,时区,最后一个参数是一个大小为8的整型数组,记录了年,月,日,时区差(以分钟计),小时,分钟,秒,毫秒.
program test_time_and_date
character(8) ::date
character(10) ::time
character(5) ::zone
integer,dimension(8) ::values
!using keyword arguments
call date_and_time(date,time,zone,values)
call date_and_time(DATE=date,ZONE=zone)
call date_and_time(TIME=time)
call date_and_time(VALUES=values)
print '(a,2x,a,2x,a)',date,time,zone
print '(8i5))',values
end program test_time_and_date
system_clock用于决定处理器时钟周期.count_rate用于决定每秒CPU的时钟计数,
PROGRAM test_system_clock
INTEGER ::count,count_rate,count_max
CALL SYSTEM_CLOCK(count,count_rate,count_max)
WRITE(*,*) count,count_rate,count_max
END PROGRAM
fortran时间函数获得的数据的单位是什么?例如cpu_time,date_and_time,system_clock
Fortran里几个有用的函数
请问fortran中real型数据的范围是多少?
C++的程序class date_and_time{ private:date d; time t; }
计算机里最小的数据单位是什么?
Fortran中 kind是什么函数?
最小的时间单位是什么,最大的时间单位是什么
时间的国际单位制单位是什么?
最小的时间单位是什么
一亿年的时间单位是什么?
时间的换算关系和单位 分开 分类出来 例如:时间的换算关系:单位:
c语言问题:一个需要实时处理新数据的程序,有很多个子函数,每单位时间就有一组新数据,然后