ulib  1.0
S.W. Lee's essential C++ library
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
uprogress.h
Go to the documentation of this file.
1 #ifndef ___uprogress___
2 #define ___uprogress___
3 
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <time.h>
7 #include "ustring.h"
8 
9 namespace ulib {
10 
22  class CUProgress {
23  public:
24  CUProgress();
25  void Begin();
26  void End();
27  double GetElapsedSec();
28  double GetElapsedSec( clock_t now_clock );
29 
30  void SetMaxCount( int max_cnt );
31  float GetPercent( int now_cnt );
32  void PrintPercent( FILE *fp, int now_cnt, char msg[]="\n" );
33  void PrintElapsedTime( FILE *fp );
34 
35 
36  private:
37  clock_t begin_clock;
38  clock_t end_clock;
39  unsigned long max_cnt;
40  };
41 
42 }
43 
44 #endif
45