URL
https://opencores.org/ocsvn/or1k/or1k/trunk
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);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.