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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [newlib/] [libc/] [time/] [difftime.c] - Blame information for rev 40

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/*
2
 * difftime.c
3
 * Original Author:     G. Haley
4
 */
5
 
6
/*
7
FUNCTION
8
<<difftime>>---subtract two times
9
 
10
INDEX
11
        difftime
12
 
13
ANSI_SYNOPSIS
14
        #include <time.h>
15
        double difftime(time_t <[tim1]>, time_t <[tim2]>);
16
 
17
TRAD_SYNOPSIS
18
        #include <time.h>
19
        double difftime(<[tim1]>, <[tim2]>)
20
        time_t <[tim1]>;
21
        time_t <[tim2]>;
22
 
23
DESCRIPTION
24
Subtracts the two times in the arguments: `<<<[tim1]> - <[tim2]>>>'.
25
 
26
RETURNS
27
The difference (in seconds) between <[tim2]> and <[tim1]>, as a <<double>>.
28
 
29
PORTABILITY
30
ANSI C requires <<difftime>>, and defines its result to be in seconds
31
in all implementations.
32
 
33
<<difftime>> requires no supporting OS subroutines.
34
*/
35
 
36
#include <time.h>
37
 
38
double
39
_DEFUN (difftime, (tim1, tim2),
40
        time_t tim1 _AND
41
        time_t tim2)
42
{
43
  return ((double) tim1 - tim2);
44
}

powered by: WebSVN 2.1.0

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