C Library Functions - system_sleep (3)
NAME
system_sleep(3f) - [M_time:C_INTERFACE] call C sleep(3c) or usleep(3c)
procedure
(LICENSE:MIT)
CONTENTS
Synopsis
Description
Options
Example
Author
License
SYNOPSIS
subroutine system_sleep(wait_seconds)
integer,intent(in) :: wait_seconds
or
real,intent(in) :: wait_seconds
DESCRIPTION
The system_sleep(3f) routine uses the intrinsic ISO_C_BINDING
interface to call the C sleep(3c) procedure or usleep(3c)
routine.
OPTIONS
|
wait_seconds |
| |
integer,real or doubleprecision number of seconds for
process to sleep.
|
|
EXAMPLE
Sample program:
program demo_system_sleep
use M_time, only : system_sleep, now
implicit none
integer :: i
!
write(*,(a))"Time before integer call is: ",now()
call system_sleep(4)
write(*,(a))"Time after integer call is: ",now()
!
write(*,(a))"Time before real call is: ",now()
call system_sleep(4.0)
write(*,(a))"Time after real call is: ",now()
!
write(*,(a))"Time before loop is: ",now()
do i=1,1000
call system_sleep(4.0/1000.0)
enddo
write(*,(a))"Time after loop is: ",now()
!
end program demo_system_sleep
results
Time before integer call is:
Sunday, July 17th, 2016 2:29:45 AM UTC-0240
Time after integer call is:
Sunday, July 17th, 2016 2:29:49 AM UTC-0240
Time before real call is:
Sunday, July 17th, 2016 2:29:49 AM UTC-0240
Time after real call is:
Sunday, July 17th, 2016 2:29:53 AM UTC-0240
Time before loop is:
Sunday, July 17th, 2016 2:29:53 AM UTC-0240
Time after loop is:
Sunday, July 17th, 2016 2:30:09 AM UTC-0240
AUTHOR
John S. Urban, 2015
LICENSE
MIT
| Nemo Release 3.1 | system_sleep (3) | June 29, 2025 |
Generated by manServer 1.08 from 12015e57-876d-4678-a703-57a801bf6fa1 using man macros.