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) June 29, 2025
Generated by manServer 1.08 from 58a268ff-f207-4a0c-b429-36c444d0d15d using man macros.