Skip to content

Commit 9a92777

Browse files
committed
Merge pull request opencv#8207 from StevenPuttemans:fix_timing_traincascade
2 parents 5d31d6e + db7922b commit 9a92777

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
@@ -139,7 +139,7 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
139139
double acceptanceRatioBreakValue )
140140
{
141141
// Start recording clock ticks for training time output
142-
const clock_t begin_time = clock();
142+
double time = (double)getTickCount();
143143

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

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

0 commit comments

Comments
 (0)