change hit count to show hit percent

This commit is contained in:
pavlov%netscape.com 2000-04-25 02:50:55 +00:00
Родитель 707e60f1a4
Коммит 820bcea575
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -93,8 +93,11 @@ nsGCCache::ReportStats() {
fprintf(stderr, " %4d", GCCacheStats.hits[i]);
hits+=GCCacheStats.hits[i];
}
fprintf(stderr, "\n\thits: %d, misses: %d, reclaimed %d times\n",
hits, GCCacheStats.misses, GCCacheStats.reclaim);
int total = hits + GCCacheStats.misses;
float percent = float(float(hits) / float(total));
percent *= 100;
fprintf(stderr, "\n\thits: %d, misses: %d, hit percent: %f%%\n",
hits, GCCacheStats.misses, percent);
);
}