Revision 68da4f12 src/envir/envirbase.cc

View differences:

src/envir/envirbase.cc
106 106
Register_GlobalConfigOption(CFGID_PRINT_UNDISPOSED, "print-undisposed", CFG_BOOL, "true", "Whether to report objects left (that is, not deallocated by simple module destructors) after network cleanup.");
107 107
Register_GlobalConfigOption(CFGID_SIMTIME_SCALE, "simtime-scale", CFG_INT, "-12", "Sets the scale exponent, and thus the resolution of time for the 64-bit fixed-point simulation time representation. Accepted values are -18..0; for example, -6 selects microsecond resolution. -12 means picosecond resolution, with a maximum simtime of ~110 days.");
108 108
Register_GlobalConfigOption(CFGID_NED_PATH, "ned-path", CFG_PATH, "", "A semicolon-separated list of directories. The directories will be regarded as roots of the NED package hierarchy, and all NED files will be loaded from their subdirectory trees. This option is normally left empty, as the OMNeT++ IDE sets the NED path automatically, and for simulations started outside the IDE it is more convenient to specify it via a command-line option or the NEDPATH environment variable.");
109
Register_GlobalConfigOption(CFGID_WRITE_RUNTIME_TO_FILE, "write-runtime-to-file", CFG_BOOL, "false", "Enables or disables writing of the simulation runtime to file.");
110
Register_GlobalConfigOption(CFGID_WRITE_RUNTIME_TO_FILENAME, "write-runtime-to-filename", CFG_STRING, "runtimes.dat", "Defines the name of the file in which the runtimes are stored.");
109 111

  
110 112
Register_PerRunConfigOption(CFGID_NETWORK, "network", CFG_STRING, NULL, "The name of the network to be simulated.  The package name can be omitted if the ini file is in the same directory as the NED file that contains the network.");
111 113
Register_PerRunConfigOption(CFGID_WARNINGS, "warnings", CFG_BOOL, "true", "Enables warnings.");
......
1673 1675
    gettimeofday(&simendtime, NULL);
1674 1676
    elapsedtime = elapsedtime + simendtime - laststarted;
1675 1677
    simulatedtime = simulation.getSimTime();
1678

  
1679
    bool storeRuntimes = getConfig()->getAsBool(CFGID_WRITE_RUNTIME_TO_FILE);
1680
    if (storeRuntimes)
1681
    {
1682
        std::string filename = getConfig()->getAsString(CFGID_WRITE_RUNTIME_TO_FILENAME);
1683
        std::ofstream outfile;
1684
        outfile.open(filename.c_str(), std::ios::out | std::ios::app);
1685
        outfile << elapsedtime.tv_sec << "." << (elapsedtime.tv_usec/1000) << endl;
1686
        outfile.close();
1687
    }
1676 1688
}
1677 1689

  
1678 1690
timeval EnvirBase::totalElapsed()

Also available in: Unified diff