]> jfr.im git - irc/quakenet/qwebirc.git/blob - qwebirc/util/hitcounter.py
Add admin engine and reorganise a lot of directory structure.
[irc/quakenet/qwebirc.git] / qwebirc / util / hitcounter.py
1 import time
2
3 class HitCounter:
4 def __init__(self):
5 self.__hits = 0
6 self.__start_time = time.time()
7
8 def __call__(self, *args):
9 self.__hits+=1
10
11 def __str__(self):
12 delta = time.time() - self.__start_time
13
14 return "Total: %d hits/s: %.2f" % (self.__hits, self.__hits / delta)
15