1 /* Author: Domen Puncer <domen@cba.si>. License: WTFPL, see file LICENSE */
9 static int bench0_count
;
10 static int bench1_count
;
12 static void bench0(u32 arg
)
20 static void bench1(u32 arg
)
28 /* hmm... context switch here takes >5us, on chibios it's 1.2us, improve when bored */
29 static void bench_print(u32 arg
)
34 printf("context switches 0:%i, 1:%i\n", bench0_count
, bench1_count
);
49 static struct task t1
, t2
, t3
;
56 .stack_len
= ALEN(s1
),
62 .stack_len
= ALEN(s2
),
68 .stack_len
= ALEN(s3
),
73 task_new(&t1
, bench0
, 0, 0);
74 task_new(&t2
, bench1
, 0, 0);
75 task_new(&t3
, bench_print
, 0, 0);