-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patht-timer.cc
45 lines (34 loc) · 1.06 KB
/
t-timer.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
using namespace std;
//using namespace lvv;
#include <stdint.h>
#include <lvv/timer.h>
using lvv::timer_t;
int main() {
cout << lvv::read_tick() << " -- 1 \n";
cout << lvv::read_tick() << " -- 1 \n";
cout << lvv::read_tick() << " -- 1 \n";
cout << lvv::read_tick() << " -- 1 \n";
cout << lvv::read_tick() << " -- 1 \n";
cout << lvv::read_tick() << " -- 1 \n";
cout << lvv::read_tick() << " -- 1 \n";
cout << lvv::read_tick() << " -- 1 \n";
cout << lvv::read_tick() << " -- 1 \n";
cout << "timer_t CTOR\n";
timer_t verboze_t(true);
timer_t t;
t.print("timer.print() MSG test");
cout << "timer()=" << t() << endl;
cout << "\n*** usleep 1000\n";
usleep(useconds_t(10000));
cout << "interval_ticks(): " << t.interval_ticks() << '\n';
t.print("2nd print()");
cout << "\n*** usleep 2000\n";
usleep(useconds_t(20000));
t.print("3rd print()");
cout << "stream << test " << t << endl;
cout << "\n*** usleep 3000\n";
usleep(useconds_t(30000));
cout << "Last line will be from timer_t destructor \n";
return 0;
}