C Library Functions  - system_sleep (3)

NAME

system_sleep(3f) - [M_system:C_INTERFACE] call C sleep(3c) or usleep(3c) procedure (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Example
Author
License

SYNOPSIS

subroutine system_sleep(wait_seconds)

      type(TYPE),intent(in)  :: wait_seconds

where TYPE may be INTEGER, REAL, or DOUBLEPRECISION

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_system, only : system_sleep
    use M_time, only : 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

Public Domain


Nemo Release 3.1 system_sleep (3) July 22, 2023
Generated by manServer 1.08 from dd8a53e6-1557-4441-b5fe-16acb4dc6858 using man macros.