simplest tool to measure C program cache hit/miss and cpu time in linux?

Use perf: perf stat ./yourapp See the kernel wiki perf tutorial for details. This uses the hardware performance counters of your CPU, so the overhead is very small. Example from the wiki: perf stat -B dd if=/dev/zero of=/dev/null count=1000000 Performance counter stats for ‘dd if=/dev/zero of=/dev/null count=1000000’: 5,099 cache-misses # 0.005 M/sec (scaled from 66.58%) … Read more

Easily measure elapsed time

//***C++11 Style:*** #include <chrono> std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now(); std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now(); std::cout << “Time difference = ” << std::chrono::duration_cast<std::chrono::microseconds>(end – begin).count() << “[µs]” << std::endl; std::cout << “Time difference = ” << std::chrono::duration_cast<std::chrono::nanoseconds> (end – begin).count() << “[ns]” << std::endl;

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)