??? 04/16/08 14:48 Read: times |
#153487 - time differences Responding to: ???'s previous message |
For a log where relevance of records decreases with their age, it is a much better approach to use time differences rather than absolute time.
So, I would store the time as the time difference (as number of minutes) to the previous event. I would also store one complete timestamp (date+time) for the newest event. When a new event arrives, I would calculate the time difference from that stored timestamp and the current running time, store that difference together with the event (possibly replacing the oldest event), then replace the timestamp for the current time. You will need slightly more than 17 bits for such time difference for up to 3 months; and if you trade in precision a little, for example to 2 minutes, you can squeeze it into 16 bits. You can also go for 16 bits and 1 minute precision, and insert fake events if there will be no real event within a month and a half. JW |
Topic | Author | Date |
saving date in zipped format | 01/01/70 00:00 | |
What precision? | 01/01/70 00:00 | |
as more as posible | 01/01/70 00:00 | |
Another approach | 01/01/70 00:00 | |
time differences | 01/01/70 00:00 | |
thanks: Reed and Waclawek | 01/01/70 00:00 |