sys_sleep Subroutine

public subroutine sys_sleep(seconds)

Sleep for specified seconds

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: seconds

Source Code

    subroutine sys_sleep(seconds)
        integer, intent(in) :: seconds
        character(len=128) :: command

        if (get_os_type() == OS_WINDOWS) then
            write (command, '(A,I0,A)') 'ping -n ', seconds + 1, ' 127.0.0.1 >nul'
        else
            write (command, '(A,I0)') 'sleep ', seconds
        end if

        call execute_command_line(command)
    end subroutine sys_sleep