-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathperf.f90
More file actions
22 lines (16 loc) · 549 Bytes
/
perf.f90
File metadata and controls
22 lines (16 loc) · 549 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! https://github.com/JuliaLang/julia/blob/master/test/perf/micro/perf.f90
module perf
use, intrinsic :: iso_fortran_env, only : dp=>REAL64,INT64, stderr=>error_unit
implicit none
contains
impure elemental real(dp) function sysclock2ms(t)
! Convert a number of clock ticks, as returned by system_clock called
! with integer(int64) arguments, to milliseconds
integer(int64), intent(in) :: t
integer(int64) :: rate
real(dp) :: r
call system_clock(count_rate=rate)
r = 1000._dp / rate
sysclock2ms = t * r
end function sysclock2ms
end Module perf