]> granicus.if.org Git - python/commit
SF patch #969180, hotshot incorrectly computes elapsed time by Jason
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 13 Jun 2004 20:45:11 +0000 (20:45 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 13 Jun 2004 20:45:11 +0000 (20:45 +0000)
commit7a135166f65232a39d1a607465bbd26ac993069a
treec69f33435bb6c86b420bf922c3aa5b8f2df7c79c
parent0f5aed4e41d1df04ffd004747fc0da4ace16350f
SF patch #969180, hotshot incorrectly computes elapsed time by Jason
Beardsley.

If the seconds are different, we still need to calculate the differences
between milliseconds.

Also, on a Gentoo Linux (2.6.5) dual Athlon MP box with glibc 2.3,
time can go backwards.  This probably happens when the process switches
the CPU it's running on.  Time can also go backwards when running NTP.
If we detect a negative time delta (ie, time went backwards), return
a delta of 0.  This prevents an illegal array access elsewhere.
I think it's safest to *not* update prev_timeofday in this case, so we
return without updating.

Backport candidate.
Modules/_hotshot.c