00001 /******************************************************************** 00002 * Copyright (C) 2012 by Verimag * 00003 * Initial author: Matthieu Moy * 00004 * This file must not be distributed outside Verimag * 00005 ********************************************************************/ 00006 00014 #include "utils/measure-time.h" 00015 00016 int main() { 00017 { 00018 measure_time t("nothing"); 00019 } 00020 { 00021 int i, j; 00022 measure_time t("real computation with a loop"); 00023 00024 /* Real computation (but don't use -O3 ...) */ 00025 for(i = 0; i <= 10000; i++) 00026 for (j = 0; j <= 100000; j++) 00027 ; 00028 } 00029 00030 { 00031 measure_time t("no real computation, but sleep(1)"); 00032 sleep(1); /* takes wall-clock time, but not CPU time */ 00033 } 00034 return 0; 00035 } 00036 00037