Bug 289275 - Don't correct eventsPerStep if the time taken was 0, because we end up at Infinity!

r=silver
a=asa
p=gijskruitbosch@gmail.com (Gijs "Hannibal" Kruitbosch)
This commit is contained in:
silver%warwickcompsoc.co.uk 2005-04-21 19:26:22 +00:00
Родитель 8539c0b350
Коммит da16af5676
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -313,8 +313,9 @@ function ep_stepevents()
en = new Date();
// i == number of items handled this time.
// We only want to do this if we handled at least 25% of our step-limit.
if (i * 4 >= this.eventsPerStep)
// We only want to do this if we handled at least 25% of our step-limit
// and if we have a sane interval between st and en (not zero).
if ((i * 4 >= this.eventsPerStep) && (en - st > 0))
{
// Calculate the number of events that can be processed in 400ms.
var newVal = (400 * i) / (en - st);