Changeset 2702


Ignore:
Timestamp:
Feb 16, 2011, 10:11:09 AM (11 years ago)
Author:
nolte
Message:

Rate Fix (Removed /0 Bug)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/KeySearcher.cs

    r2685 r2702  
    13611361                var timenow = DateTime.UtcNow;
    13621362
    1363                 ((QuickWatch) QuickWatchPresentation).StatisticsPresentation.SetCurrentRate = (keysnow - memKeys) /
    1364                                                                                               (timenow.Subtract(memTime).Seconds);
     1363                var diff = (BigInteger) timenow.Subtract(memTime).TotalSeconds;
     1364                if(diff > 0)
     1365                {
     1366                   ((QuickWatch) QuickWatchPresentation).StatisticsPresentation.SetCurrentRate = (keysnow - memKeys) /
     1367                                                                                              ((BigInteger)timenow.Subtract(memTime).TotalSeconds);
     1368                }
    13651369                memKeys = keysnow;
    13661370                memTime = timenow;
     
    14711475                ((QuickWatch)QuickWatchPresentation).StatisticsPresentation.CalculatedKeys = calcKeys;
    14721476                ((QuickWatch)QuickWatchPresentation).StatisticsPresentation.Percent = (double)calcChunks;
    1473                 ((QuickWatch)QuickWatchPresentation).StatisticsPresentation.SetRate = calcKeys/ diffFromStart.Seconds;
    14741477                ((QuickWatch)QuickWatchPresentation).StatisticsPresentation.Users = statistic.Keys.Count;
    14751478                ((QuickWatch)QuickWatchPresentation).StatisticsPresentation.Machines = maschinehierarchie.Keys.Count;
     1479                if ((BigInteger)diffFromStart.TotalSeconds > 0)
     1480                {
     1481                    ((QuickWatch)QuickWatchPresentation).StatisticsPresentation.SetRate = calcKeys / (BigInteger)diffFromStart.TotalSeconds;
     1482                }
    14761483                if (statistic.Count > 0)
    14771484                {
Note: See TracChangeset for help on using the changeset viewer.