| | 1 | [[TOC]] |
| | 2 | = CMillisecondTimer = |
| | 3 | |
| | 4 | CMillisecondTimer is a C++ class for timer functions. |
| | 5 | |
| | 6 | == Constructors == |
| | 7 | |
| | 8 | {{{ |
| | 9 | CMillisecondTimer(void); |
| | 10 | |
| | 11 | CMillisecondTimer(int nMilliseconds, bool bAutoRepeat = false); |
| | 12 | }}} |
| | 13 | |
| | 14 | ==== Parameters ==== |
| | 15 | * nMilliseconds - Time interval value in milliseconds |
| | 16 | * bAutoRepeat - True for a repeating timer. |
| | 17 | |
| | 18 | ==== Example ==== |
| | 19 | |
| | 20 | {{{ |
| | 21 | CMillisecondTimer tmr(3000, true); |
| | 22 | |
| | 23 | tmr.Start(); // Start 3 second count |
| | 24 | |
| | 25 | while(1) |
| | 26 | { |
| | 27 | // ... We can do some processing here |
| | 28 | if(tmr.IsExpired()) |
| | 29 | { |
| | 30 | // Do something every three seconds |
| | 31 | } |
| | 32 | } |
| | 33 | }}} |
| | 34 | |
| | 35 | |
| | 36 | == Member Functions == |
| | 37 | |
| | 38 | === Set === |
| | 39 | |
| | 40 | {{{ |
| | 41 | void Set(int nMilliseconds, bool bAutoRepeat = false); |
| | 42 | }}} |
| | 43 | |
| | 44 | ==== Parameters ==== |
| | 45 | * nMilliseconds - Timer interval in milliseconds |
| | 46 | * bAutoRepeat - True for repeating timer. |
| | 47 | |
| | 48 | ==== Return Value ==== |
| | 49 | |
| | 50 | Function does not return a value. |
| | 51 | |
| | 52 | ==== Remarks ==== |
| | 53 | |
| | 54 | ==== Example ==== |
| | 55 | |
| | 56 | {{{ |
| | 57 | |
| | 58 | }}} |
| | 59 | |
| | 60 | === Clear === |
| | 61 | |
| | 62 | {{{ |
| | 63 | void Clear(void); |
| | 64 | }}} |
| | 65 | |
| | 66 | ==== Parameters ==== |
| | 67 | |
| | 68 | Function does not accept any parameters. |
| | 69 | |
| | 70 | ==== Return Value ==== |
| | 71 | |
| | 72 | Function does not return a value. |
| | 73 | |
| | 74 | ==== Remarks ==== |
| | 75 | |
| | 76 | ==== Example ==== |
| | 77 | |
| | 78 | {{{ |
| | 79 | |
| | 80 | }}} |