source: trunk/libs/newlib/src/newlib/libc/time/difftime.c @ 577

Last change on this file since 577 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 625 bytes
Line 
1/*
2 * difftime.c
3 * Original Author:     G. Haley
4 */
5
6/*
7FUNCTION
8<<difftime>>---subtract two times
9
10INDEX
11        difftime
12
13SYNOPSIS
14        #include <time.h>
15        double difftime(time_t <[tim1]>, time_t <[tim2]>);
16
17DESCRIPTION
18Subtracts the two times in the arguments: `<<<[tim1]> - <[tim2]>>>'.
19
20RETURNS
21The difference (in seconds) between <[tim2]> and <[tim1]>, as a <<double>>.
22
23PORTABILITY
24ANSI C requires <<difftime>>, and defines its result to be in seconds
25in all implementations.
26
27<<difftime>> requires no supporting OS subroutines.
28*/
29
30#include <time.h>
31
32double
33difftime (time_t tim1,
34        time_t tim2)
35{
36  return (double)(tim1 - tim2);
37}
Note: See TracBrowser for help on using the repository browser.