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