]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MINOR] add curr_sec_ms and curr_sec_ms_scaled for current second.
authorWilly Tarreau <w@1wt.eu>
Thu, 5 Mar 2009 13:54:50 +0000 (14:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 5 Mar 2009 15:56:16 +0000 (16:56 +0100)
commit755905857ac26c28d9886ab94c410b6fec4de192
tree3749f059843fc1693e18aa6679d15bbc62b6e6f5
parent776cd87e321f403929898ad5167f48040c24460e
[MINOR] add curr_sec_ms and curr_sec_ms_scaled for current second.

Several algorithms will need to know the millisecond value within
the current second. Instead of doing a divide every time it is needed,
it's better to compute it when it changes, which is when now and now_ms
are recomputed.

curr_sec_ms_scaled is the same multiplied by 2^32/1000, which will be
useful to compute some ratios based on the position within last second.
include/common/time.h
src/time.c