5 subroutine call_msleep(m
)
7 use, intrinsic :: iso_c_binding
, only
: c_long
12 ! Correctly declare the C function as a subroutine in Fortran
13 subroutine msleep(msec
) bind(C
, name
="msleep")
15 integer(c_long
), value
:: msec
19 integer :: m
! argument
20 integer(c_long
) :: msec_c_long
! local
22 ! Call the C subroutine
23 msec_c_long
= int(m
, kind
=c_long
)
24 call msleep(msec_c_long
) ! Sleep for 1000 milliseconds or 1 second
25 end subroutine call_msleep
27 end module module_msleep