X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/455a9c602ca8bf5bff5c942cbde83eb648318af1..aaebf25b76842b1369d4305499203166303a45fe:/teshsuite/s4u/evaluate-parse-time/evaluate-parse-time.cpp diff --git a/teshsuite/s4u/evaluate-parse-time/evaluate-parse-time.cpp b/teshsuite/s4u/evaluate-parse-time/evaluate-parse-time.cpp new file mode 100644 index 0000000000..2eb12c6fc0 --- /dev/null +++ b/teshsuite/s4u/evaluate-parse-time/evaluate-parse-time.cpp @@ -0,0 +1,33 @@ +/* Copyright (c) 2008-2020. The SimGrid Team. All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +// teshsuite/s4u/evaluate-parse-time/evaluate-parse-time examples/platforms/g5k.xml + +#include + +#include "simgrid/s4u/Engine.hpp" +#include "xbt/xbt_os_time.h" + +int main(int argc, char** argv) +{ + xbt_os_timer_t timer = xbt_os_timer_new(); + simgrid::s4u::Engine e(&argc, argv); + + /* creation of the environment, timed */ + xbt_os_cputimer_start(timer); + e.load_platform(argv[1]); + xbt_os_cputimer_stop(timer); + + /* Display the result and exit after cleanup */ + printf("%f\n", xbt_os_timer_elapsed(timer)); + printf("Host number: %zu, link number: %zu\n", e.get_host_count(), e.get_link_count()); + if (argv[2]) { + printf("Wait for %ss\n", argv[2]); + xbt_os_sleep(atoi(argv[2])); + } + + free(timer); + return 0; +}