Skip to content

Commit ab806b6

Browse files
author
StevenPuttemans
committed
backport of PR opencv#8207
1 parent 0051744 commit ab806b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/traincascade/cascadeclassifier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
140140
double acceptanceRatioBreakValue)
141141
{
142142
// Start recording clock ticks for training time output
143-
const clock_t begin_time = clock();
143+
double time = (double)getTickCount();
144144

145145
if( _cascadeDirName.empty() || _posFilename.empty() || _negFilename.empty() )
146146
CV_Error( CV_StsBadArg, "_cascadeDirName or _bgfileName or _vecFileName is NULL" );
@@ -268,7 +268,7 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
268268
fs << "}";
269269

270270
// Output training time up till now
271-
float seconds = float( clock () - begin_time ) / CLOCKS_PER_SEC;
271+
double seconds = ( (double)getTickCount() - time)/ getTickFrequency();
272272
int days = int(seconds) / 60 / 60 / 24;
273273
int hours = (int(seconds) / 60 / 60) % 24;
274274
int minutes = (int(seconds) / 60) % 60;

0 commit comments

Comments
 (0)