New answers tagged timer
1
Avoid storing data unnecessarily
Your class stores the start time, stop time and frequency in member variables, however you only need to store the start time:
class Timer {
LARGE_INTEGER start_count;
public:
// Query performance counter at the start of a block of code
void start() {
QueryPerformanceCounter(&start_count);
}
//...
2
Welcome to codereview.se and thanks for sharing your code.
Here is what I think about it. Please keep in mind, that this is my personal view on it.
Do not use the Java Singelton pattern.
The singelton pattern is just another name for a global variable, which we consider harmful and bad coding since the early days of programming.
Also the pattern is not that ...
Top 50 recent answers are included
Related Tags
timer × 284javascript × 57
c# × 50
java × 42
c++ × 41
python × 32
beginner × 31
multithreading × 25
datetime × 22
performance × 17
c++11 × 16
game × 14
jquery × 13
c × 11
object-oriented × 10
swing × 9
animation × 9
scheduled-tasks × 9
python-3.x × 8
android × 8
error-handling × 8
thread-safety × 8
winforms × 8
benchmarking × 8
.net × 7