chap10/sample4.f90
1program sample
2 implicit none
3
4 integer :: i
5 real(8) :: x, y, pi, t1, t2
6
7 call cpu_time(t1)
8
9 do i = 1, 20000000
10 pi = 4.0_8 * atan(1.0_8)
11 y = cos(2 * pi * x)
12 x = y
13 enddo
14
15 call cpu_time(t2)
16
17 write(*, '("CPU Time [sec] : ", e12.4)') t2 - t1
18
19 stop
20endprogram sample