C Library Functions  - ordinal_seconds (3)

NAME

ordinal_seconds(3f) - [M_time:ORDINAL_DAY] seconds since beginning of year (LICENSE:MIT)

CONTENTS

Synopsis
Description
Example
Author
License

SYNOPSIS

function ordinal_seconds()

    integer :: ordinal_seconds

DESCRIPTION

Return number of seconds since beginning of current year.

Before using this routine consider the consequences if the application is running at the moment a new year begins.

EXAMPLE

sample program

    program demo_ordinal_seconds
    use M_time, only : ordinal_seconds
    implicit none
    character(len=*),parameter :: gen=’(*(g0))’
    integer          :: i, istart, iend
    real,volatile    :: x
    istart = ordinal_seconds()
    x = 0.0
    do i = 1, 1000000000
       x = x+sqrt(real(i))
    enddo
    print gen, ’x=’,x
    iend = ordinal_seconds()
    print gen, ’that took ’,iend-istart,’ seconds’
    print gen, iend,’-’,istart,’=’,iend-istart
    end program demo_ordinal_seconds

Results:

    > x=0.549755814E+12
    > that took 4 seconds
    > 23659912-23659908=4

AUTHOR

John S. Urban, 2015

LICENSE

    MIT


Nemo Release 3.1 ordinal_seconds (3) February 23, 2025
Generated by manServer 1.08 from cdddb938-26c9-4222-b0af-a6fd97992916 using man macros.