move profiler from main.cpp to profiler.cpp