Timer::_timeout should be double and it should be allowed to have fractions.

This commit is contained in:
Axel Kohlmeyer
2024-06-29 03:43:26 -04:00
parent 8397738978
commit 246698d3c2
4 changed files with 20 additions and 10 deletions

View File

@ -28,8 +28,8 @@ Timer::Timer(LAMMPS *_lmp) : Pointers(_lmp)
{
_level = NORMAL;
_sync = OFF;
_timeout = -1;
_s_timeout = -1;
_timeout = -1.0;
_s_timeout = -1.0;
_checkfreq = 10;
_nextcheck = -1;
this->_stamp(RESET);
@ -251,7 +251,7 @@ void Timer::modify_params(int narg, char **arg)
// format timeout setting
std::string timeout = "off";
if (_timeout >= 0) {
if (_timeout >= 0.0) {
std::tm tv = fmt::gmtime((std::time_t) _timeout);
timeout = fmt::format("{:02d}:{:%M:%S}", tv.tm_yday * 24 + tv.tm_hour, tv);
}