; line と boxf のベンチマーク #include "d3m.hsp" #define SCR_W 640 #define SCR_H 360 #packopt name "bench" ; 生成ファイル名 #packopt type 0 ; .exe生成を指定 #packopt xsize SCR_W #packopt ysize SCR_H onkey goto *jobend ; get windows size screen 0, SCR_W, SCR_H, 0 gsel 0 ; width SCR_W, SCR_H dispw = ginfo_winx disph = ginfo_winy cls 4 *mainloop ; ESC key to exit stick k if k & 128 : goto *jobend redraw 0 ; 描画開始 gsel 0 gmode 0 lp = 1000 starttime = d3timer() repeat lp repeat (disph - 1) color 16, 32, 64 ; line x1, y1, x0, y0 line dispw, cnt, 0, cnt ; pos 0, cnt ; line dispw, cnt loop loop tm1 = d3timer() - starttime starttime = d3timer() repeat lp repeat (disph - 1) color 16, 32, 64 ; boxf x0, y0, x1, y1 boxf 0, cnt, dispw, cnt loop loop tm2 = d3timer() - starttime color 255, 255, 255 pos 8, 8 mes "line : " + tm1 pos 8, 32 mes "boxf : " + tm2 redraw 1 ; 描画終了 await (1000 / 60) goto *mainloop *jobend end