mirror of
https://github.com/yourtion/30dayMakeOS.git
synced 2026-02-03 01:53:24 +08:00
测试运行速度
This commit is contained in:
@@ -285,8 +285,8 @@ void make_textbox8(struct SHEET *sht, int x0, int y0, int sx, int sy, int c)
|
||||
void task_b_main(struct SHEET *sht_back)
|
||||
{
|
||||
struct FIFO32 fifo;
|
||||
struct TIMER *timer_ts, *timer_put;
|
||||
int i, fifobuf[128], count = 0;
|
||||
struct TIMER *timer_ts, *timer_put, *timer_1s;
|
||||
int i, fifobuf[128], count = 0, count0 = 0;
|
||||
char s[12];
|
||||
|
||||
fifo32_init(&fifo, 128, fifobuf);
|
||||
@@ -295,7 +295,10 @@ void task_b_main(struct SHEET *sht_back)
|
||||
timer_settime(timer_ts, 2);
|
||||
timer_put = timer_alloc();
|
||||
timer_init(timer_put, &fifo, 1);
|
||||
timer_settime(timer_put, 1);
|
||||
timer_settime(timer_put, 1);
|
||||
timer_1s = timer_alloc();
|
||||
timer_init(timer_1s, &fifo, 100);
|
||||
timer_settime(timer_1s, 100);
|
||||
|
||||
for (;;) {
|
||||
count++;
|
||||
@@ -314,6 +317,11 @@ void task_b_main(struct SHEET *sht_back)
|
||||
} else if (i == 2) {
|
||||
farjmp(0, 3 * 8);
|
||||
timer_settime(timer_ts, 2);
|
||||
} else if (i == 100) {
|
||||
sprintf(s, "%11d", count - count0);
|
||||
putfonts8_asc_sht(sht_back, 0, 128, COL8_FFFFFF, COL8_008484, s, 11);
|
||||
count0 = count;
|
||||
timer_settime(timer_1s, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user