Skip to content

Commit

Permalink
avoid division by zero when index transfer is extremely fast
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1269 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
hermens committed Dec 29, 2005
1 parent 26bab87 commit 11fe958
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/de/anomic/plasma/plasmaWordIndexDistribution.java
Expand Up @@ -735,7 +735,9 @@ public float getTransferedEntityPercent() {
}

public int getTransferedEntitySpeed() {
return (int) ((1000 * transferedEntryCount) / (System.currentTimeMillis()-startingTime));
long transferTime = System.currentTimeMillis() - startingTime;
if (transferTime <= 0) transferTime = 1;
return (int) ((1000 * transferedEntryCount) / transferTime);
}

public yacySeed getSeed() {
Expand Down Expand Up @@ -929,4 +931,4 @@ private boolean isAborted() {
*/
}

}
}

0 comments on commit 11fe958

Please sign in to comment.