Rev 1269 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1270 | giacomo | 1 | //package first_filter; |
1269 | trimarchi | 2 | |
3 | /** |
||
4 | * <p>Title: First XML filter</p> |
||
5 | * <p>Description: </p> |
||
6 | * <p>Copyright: Copyright (c) 2003</p> |
||
7 | * <p>Company: Retis Lab</p> |
||
8 | * @author not attributable |
||
9 | * @version 1.0 |
||
10 | */ |
||
11 | |||
12 | public class timespec { |
||
13 | long tv_sec; |
||
14 | long tv_nsec; |
||
15 | |||
16 | public timespec() { |
||
17 | tv_sec=0; |
||
18 | tv_nsec=0; |
||
19 | } |
||
20 | |||
21 | |||
22 | void ADDUSEC2TIMESPEC(long t1) { |
||
23 | tv_nsec+=(t1%1000000)*1000; |
||
24 | tv_sec+=(tv_nsec / 1000000000)+(t1/1000000); |
||
25 | tv_nsec%=1000000000; |
||
26 | } |
||
27 | long TIMESPEC2USEC() { |
||
28 | return (tv_sec*1000000+tv_nsec/1000); |
||
29 | } |
||
30 | boolean TIMESPEC_A_GT_B(timespec t1) { |
||
31 | |||
32 | return (tv_sec>t1.tv_sec || |
||
33 | (tv_sec==t1.tv_sec && tv_nsec>t1.tv_nsec)); |
||
34 | |||
35 | } |
||
36 | |||
1270 | giacomo | 37 | } |