From: cristianrosa Date: Tue, 15 Feb 2011 16:08:35 +0000 (+0000) Subject: Compute the real simulation time. X-Git-Tag: v3.6_beta2~306 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0be699a59205480f6461147fc17f874140be49e7?hp=fc1f64e80cd03f4f1c74d92497326e8c2f92dc12 Compute the real simulation time. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9627 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/examples/msg/chord/chord.c b/examples/msg/chord/chord.c index 307d519eea..773fb4b5ac 100644 --- a/examples/msg/chord/chord.c +++ b/examples/msg/chord/chord.c @@ -11,6 +11,8 @@ #include "xbt/asserts.h" #include "mc/modelchecker.h" #include "mc/mc.h" +#include "xbt/xbt_os_time.h" + XBT_LOG_NEW_DEFAULT_CATEGORY(msg_chord, "Messages specific for this msg example"); @@ -887,6 +889,8 @@ static void random_lookup(node_t node) */ int main(int argc, char *argv[]) { + xbt_os_timer_t timer = xbt_os_timer_new(); + if (argc < 3) { printf("Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n", argv[0]); printf("example: %s ../msg_platform.xml chord.xml\n", argv[0]); @@ -928,7 +932,10 @@ int main(int argc, char *argv[]) MSG_function_register("node", node); MSG_launch_application(application_file); + xbt_os_timer_start(timer); MSG_error_t res = MSG_main(); + xbt_os_timer_stop(timer); + CRITICAL1("Simulation time %lf", xbt_os_timer_elapsed(timer)); INFO1("Simulated time: %g", MSG_get_clock()); MSG_clean();