//--------------------------------------------------------- // medir.nulo.cc //--------------------------------------------------------- #include #include #include #include int main() { using namespace std::chrono; auto start = high_resolution_clock::now(); switch(fork()) { case -1: std::cout << "fallo en fork()!"; break; case 0: execl("./nulo", "./nulo", nullptr); break; default: wait(nullptr); break; } auto stop = high_resolution_clock::now(); std::cout << "la ejecuciĆ³n del proceso nulo tarda " << duration_cast(stop - start).count() << " ns" << std::endl; }