~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpeglib/lib/output/performance.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  measures picture/second
 
3
  Copyright (C) 2000  Martin Vogt
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
#include "performance.h"
 
15
 
 
16
 
 
17
Performance::Performance() {
 
18
  picCnt=0;
 
19
  startTime=new TimeStamp();
 
20
  endTime=new TimeStamp();
 
21
 
 
22
}
 
23
 
 
24
 
 
25
Performance::~Performance() {
 
26
  delete startTime;
 
27
  delete endTime;
 
28
}
 
29
 
 
30
 
 
31
void Performance::incPictureCount() {
 
32
  if (picCnt==0) {
 
33
    startTime->gettimeofday();
 
34
  }
 
35
  picCnt++;
 
36
  if (picCnt==200) {
 
37
    endTime->gettimeofday();
 
38
    TimeStamp diffTime;
 
39
    endTime->minus(startTime,&diffTime);
 
40
    double secs=(double)diffTime.getAsSeconds();
 
41
 
 
42
    double picSec=(double)picCnt/secs;
 
43
    cout << "picPerSec:"<<picSec<<" secs:"<<secs<<endl;
 
44
    picCnt=0;
 
45
  }
 
46
}