기업연계 프로젝트2 15조 팀명: 소도기
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
373 B

5 years ago
  1. #ifndef __TIMER_H_
  2. #define __TIMER_H_
  3. class Timer {
  4. private:
  5. unsigned long prev;
  6. unsigned long current;
  7. public:
  8. Timer() {
  9. current = prev = millis();
  10. }
  11. inline void ChkFirst() {
  12. prev = millis();
  13. }
  14. inline void ChkLast() {
  15. current = millis();
  16. }
  17. unsigned long GetSecond() {return (current - prev) / 1000;}
  18. };
  19. #endif