added time profiling