source:
trunk/minix/lib/ansi/difftime.c@
12
Last change on this file since 12 was 9, checked in by , 14 years ago | |
---|---|
File size: 398 bytes |
Line | |
---|---|
1 | /* |
2 | * difftime - compute the difference between two calendar times |
3 | */ |
4 | /* $Header: /cvsup/minix/src/lib/ansi/difftime.c,v 1.1.1.1 2005/04/21 14:56:04 beng Exp $ */ |
5 | |
6 | #include <time.h> |
7 | |
8 | double |
9 | difftime(time_t time1, time_t time0) |
10 | { |
11 | /* be careful: time_t may be unsigned */ |
12 | if ((time_t)-1 > 0 && time0 > time1) { |
13 | return - (double) (time0 - time1); |
14 | } else { |
15 | return (double)(time1 - time0); |
16 | } |
17 | } |
Note:
See TracBrowser
for help on using the repository browser.