]> pd.if.org Git - mmurtl/blob - msamples/busyloop/busyloop.c
autocommit for file dated 1995-02-09 15:58:06
[mmurtl] / msamples / busyloop / busyloop.c
1 /* Busy loop demonstrates the preemptive capabilites of MMURTL.\r
2    It doesn't go through the kernel and never sleeps. It is\r
3    a task that is ALWAYS ready to run.\r
4 \r
5    It runs at the default priority of 25, and rest assured,\r
6    other higher priority tasks will receive messages and be\r
7    queued to run.\r
8 \r
9    If you run it, you will have to use the CTRL-ALT-DELETE keys\r
10    to kill it.\r
11    To build, use MakeIt.bat, or use CM32 or DASM separately:\r
12    CM32 BusyLoop.c\r
13    DASM BusyLoop.atf\r
14 */\r
15 \r
16 #include <stdio.h>\r
17 #include "\OSSource\Mtimer.h"\r
18 #include "\OSSource\MJob.h"\r
19 \r
20 unsigned long tick;\r
21 \r
22 void main(void)\r
23 {\r
24 long i;\r
25         SetJobName("BusyLoop", 8);\r
26         Sleep(100); /* A small delay before we start eating CPU time */\r
27         while (1) \r
28         {\r
29                 GetTimerTick(&tick);\r
30             printf("%d \r\n", tick);\r
31                 i++;\r
32         }\r
33 }\r