Add profiling and Ctrl-C handling