Skip to content

Commit

Permalink
测试运行速度
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed Apr 22, 2016
1 parent dc8c366 commit 991f105
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions 15_day/bootpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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++;
Expand All @@ -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);
}
}
}
Expand Down

0 comments on commit 991f105

Please sign in to comment.