abc123mewot

Untitled

May 31st, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #ifndef _PROGRESS
  2. #define _PROGRESS
  3.  
  4. #include <stdint.h>
  5.  
  6. struct Progress {
  7.     uint64_t start, stop;
  8.     uint64_t current;
  9.     Progress(){
  10.         this->start = 0;
  11.         this->stop = 0;
  12.         this->current = 0;
  13.     }
  14.     Progress(uint64_t start, uint64_t stop) {
  15.         this->start = start;
  16.         this->stop = stop;
  17.         this->current = 0;
  18.     };
  19.     double percent() {
  20.         return ((current - start) / (double)(stop - start));
  21.     };
  22. };
  23.  
  24. #endif
Advertisement
Add Comment
Please, Sign In to add comment