OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [time/] [difftime.c] - Diff between revs 1010 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 1010 Rev 1765
/*
/*
 * difftime.c
 * difftime.c
 * Original Author:     G. Haley
 * Original Author:     G. Haley
 */
 */
 
 
/*
/*
FUNCTION
FUNCTION
<<difftime>>---subtract two times
<<difftime>>---subtract two times
 
 
INDEX
INDEX
        difftime
        difftime
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <time.h>
        #include <time.h>
        double difftime(time_t <[tim1]>, time_t <[tim2]>);
        double difftime(time_t <[tim1]>, time_t <[tim2]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <time.h>
        #include <time.h>
        double difftime(<[tim1]>, <[tim2]>)
        double difftime(<[tim1]>, <[tim2]>)
        time_t <[tim1]>;
        time_t <[tim1]>;
        time_t <[tim2]>;
        time_t <[tim2]>;
 
 
DESCRIPTION
DESCRIPTION
Subtracts the two times in the arguments: `<<<[tim1]> - <[tim2]>>>'.
Subtracts the two times in the arguments: `<<<[tim1]> - <[tim2]>>>'.
 
 
RETURNS
RETURNS
The difference (in seconds) between <[tim2]> and <[tim1]>, as a <<double>>.
The difference (in seconds) between <[tim2]> and <[tim1]>, as a <<double>>.
 
 
PORTABILITY
PORTABILITY
ANSI C requires <<difftime>>, and defines its result to be in seconds
ANSI C requires <<difftime>>, and defines its result to be in seconds
in all implementations.
in all implementations.
 
 
<<difftime>> requires no supporting OS subroutines.
<<difftime>> requires no supporting OS subroutines.
*/
*/
 
 
#include <time.h>
#include <time.h>
 
 
double
double
_DEFUN (difftime, (tim1, tim2),
_DEFUN (difftime, (tim1, tim2),
        time_t tim1 _AND
        time_t tim1 _AND
        time_t tim2)
        time_t tim2)
{
{
  return ((double) tim1 - tim2);
  return ((double) tim1 - tim2);
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.