! time_test.f90 program time_test implicit none double precision :: start, now, next integer :: clock_count, clock_rate, clock_max integer :: i=0 print *, 'time_test' call system_clock(count=clock_count, count_rate=clock_rate, & count_max=clock_max) print *, 'clock_count=', clock_count, ', clock_rate=', clock_rate, & ', clock_max=', clock_max start = (1.0D0+clock_count)/clock_rate print *, i, ' should print every 5 seconds' call system_clock(count=clock_count) now = (1.0D0+clock_count)/clock_rate do while(i<90) call system_clock(count=clock_count) next = (1.0D0+clock_count)/clock_rate if(next>now+5.0) then i = i+5 print *, i now = next end if end do print *, ' took ', now-start, ' seconds' end program time_test