Manual Reference Pages  - system_sleep (3m_system)

NAME

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

CONTENTS

Synopsis
Description
Options
Examples
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.

EXAMPLES

Sample program:

    program demo_system_sleep
    use M_system, only : system_sleep, epoch_to_calendar
    implicit none
    integer :: i
       !
       write(*,’(2a)’)"Time before integer call is: ",epoch_to_calendar()
       call system_sleep(4)
       write(*,’(2a)’)"Time after  integer call is: ",epoch_to_calendar()
       write(*,*)
       write(*,’(2a)’)"Time before real call is: ",epoch_to_calendar()
       call system_sleep(4.0)
       write(*,’(2a)’)"Time after  real call is: ",epoch_to_calendar()
       write(*,*)
       write(*,’(2a)’)"Time before loop is: ",epoch_to_calendar()
       do i=1,1000
          call system_sleep(4.0/1000.0)
       enddo
       write(*,’(2a)’)"Time after loop  is: ",epoch_to_calendar()
    end program demo_system_sleep

Results:

    > Time before integer call is: 2023-10-03 01:11:14 UTC-240
    > Time after  integer call is: 2023-10-03 01:11:18 UTC-240
    >
    > Time before real call is: 2023-10-03 01:11:18 UTC-240
    > Time after  real call is: 2023-10-03 01:11:22 UTC-240
    >
    > Time before loop is: 2023-10-03 01:11:22 UTC-240
    > Time after loop  is: 2023-10-03 01:11:26 UTC-240

AUTHOR

John S. Urban, 2015

LICENSE

Public Domain


Nemo Release 3.1 system_sleep (3m_system) March 07, 2025
Generated by manServer 1.08 from 24a7f9a9-8fb6-49e9-88d4-f8f01b4fe12b using man macros.