Python class to benchmark pieces of code by timer and resources usage.