mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Moving time stamp function to output.
This commit is contained in:
parent
1b71af6baa
commit
96e5007276
3 changed files with 23 additions and 11 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include <iomanip> // for setw
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <ctime>
|
||||
|
||||
#include "openmc/cell.h"
|
||||
#include "openmc/geometry.h"
|
||||
|
|
@ -39,6 +40,18 @@ header(const char* msg, int level) {
|
|||
}
|
||||
}
|
||||
|
||||
std::string time_stamp()
|
||||
{
|
||||
int base_year = 1990;
|
||||
std::stringstream ts;
|
||||
std::time_t t = std::time(0); // get time now
|
||||
std::tm* now = std::localtime(&t);
|
||||
ts << now->tm_year + base_year << "-" << now->tm_mon
|
||||
<< "-" << now->tm_mday << " " << now->tm_hour
|
||||
<< ":" << now->tm_min << ":" << now->tm_sec;
|
||||
return ts.str();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
||||
void print_overlap_check() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue