equal
deleted
inserted
replaced
1 #include <stdio.h> |
1 #include <stdio.h> |
2 #include <sys/timeb.h> |
2 #include <sys/timeb.h> |
3 #include <time.h> |
3 #include <time.h> |
4 #include <windows.h> |
4 #include <windows.h> |
5 |
5 |
|
6 int localcount = 0; |
|
7 |
6 void timer_notify() |
8 void timer_notify() |
7 { |
9 { |
8 struct _timeb timebuffer; |
10 struct _timeb timebuffer; |
9 printf("."); |
11 if(++localcount % 50 == 0){ |
|
12 printf("PLC tick : %d\n",localcount); |
|
13 fflush(stdout); |
|
14 } |
10 |
15 |
11 _ftime( &timebuffer ); |
16 _ftime( &timebuffer ); |
12 __CURRENT_TIME.tv_sec = timebuffer.time; |
17 __CURRENT_TIME.tv_sec = timebuffer.time; |
13 __CURRENT_TIME.tv_nsec = timebuffer.millitm * 1000000; |
18 __CURRENT_TIME.tv_nsec = timebuffer.millitm * 1000000; |
14 __run(); |
19 __run(); |