@@ -533,7 +533,7 @@ bool BerkeleyDatabase::Rewrite(const char* pszSkip)
533533
534534void BerkeleyEnvironment::Flush (bool fShutdown )
535535{
536- int64_t nStart = GetTimeMillis () ;
536+ const auto start{ SteadyClock::now ()} ;
537537 // Flush log data to the actual data file on all files that are not in use
538538 LogPrint (BCLog::WALLETDB, " BerkeleyEnvironment::Flush: [%s] Flush(%s)%s\n " , strPath, fShutdown ? " true" : " false" , fDbEnvInit ? " " : " database not started" );
539539 if (!fDbEnvInit )
@@ -561,7 +561,7 @@ void BerkeleyEnvironment::Flush(bool fShutdown)
561561 no_dbs_accessed = false ;
562562 }
563563 }
564- LogPrint (BCLog::WALLETDB, " BerkeleyEnvironment::Flush: Flush(%s)%s took %15dms\n " , fShutdown ? " true" : " false" , fDbEnvInit ? " " : " database not started" , GetTimeMillis ( ) - nStart );
564+ LogPrint (BCLog::WALLETDB, " BerkeleyEnvironment::Flush: Flush(%s)%s took %15dms\n " , fShutdown ? " true" : " false" , fDbEnvInit ? " " : " database not started" , Ticks<std::chrono::milliseconds>( SteadyClock::now ( ) - start) );
565565 if (fShutdown ) {
566566 char ** listp;
567567 if (no_dbs_accessed) {
@@ -591,14 +591,14 @@ bool BerkeleyDatabase::PeriodicFlush()
591591
592592 const std::string strFile = fs::PathToString (m_filename);
593593 LogPrint (BCLog::WALLETDB, " Flushing %s\n " , strFile);
594- int64_t nStart = GetTimeMillis () ;
594+ const auto start{ SteadyClock::now ()} ;
595595
596596 // Flush wallet file so it's self contained
597597 env->CloseDb (m_filename);
598598 env->CheckpointLSN (strFile);
599599 m_refcount = -1 ;
600600
601- LogPrint (BCLog::WALLETDB, " Flushed %s %dms\n " , strFile, GetTimeMillis ( ) - nStart );
601+ LogPrint (BCLog::WALLETDB, " Flushed %s %dms\n " , strFile, Ticks<std::chrono::milliseconds>( SteadyClock::now ( ) - start) );
602602
603603 return true ;
604604}
0 commit comments