Barst  2.0
A server that controls lab hardware.
misc tools.h
1 
4 #ifndef MISC_TOOLS_H
5 #define MISC_TOOLS_H
6 
7 
8 #include <Windows.h>
9 
10 #define PRAGMA_STR1(x) #x
11 #define PRAGMA_STR2(x) PRAGMA_STR1 (x)
12 #define NOTE(x) message (__FILE__ "(" PRAGMA_STR2(__LINE__) ") : -NOTE- " #x)
13 
14 
15 
16 const char *ToBinary(unsigned char ucVal, char csBuff[9]);
17 
18 
32 BOOL GetProcAddresses(HINSTANCE *hLibrary, LPCTSTR lpszLibrary, INT nCount, ... );
33 
34 
48 class CTimer
49 {
50 public:
52  CTimer();
53  virtual ~CTimer();
54 
57  double Seconds() const;
62  double Seconds(LARGE_INTEGER llStart) const;
67  double TimeOf(LARGE_INTEGER llTime) const;
69  LARGE_INTEGER GetStart() const { return m_llStart;}
72  void ResetTimer();
73 private:
74  LARGE_INTEGER m_llFrequency; // Performance counter frequency or zero
75  LARGE_INTEGER m_llStart; // The value of the performance counter when reset was called.
76 };
77 
78 
79 extern CTimer g_cTimer;
80 
81 #endif
double TimeOf(LARGE_INTEGER llTime) const
Definition: misc tools.cpp:89
LARGE_INTEGER GetStart() const
Definition: misc tools.h:69
void ResetTimer()
Definition: misc tools.cpp:99
double Seconds() const
Definition: misc tools.cpp:63