Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "windows.bi"
- #include "crt.bi"
- dim shared as handle hCon
- dim shared as CONSOLE_SCREEN_BUFFER_INFO tConInfo
- dim shared as integer ConWid,ConHei
- hCon = GetStdHandle( STD_OUTPUT_HANDLE )
- GetConsoleScreenBufferInfo( hCon , @tConInfo )
- ConWid = ( tConInfo.srWindow.Right - tConInfo.srWindow.Left ) + 1
- ConHei = ( tConInfo.srWindow.Bottom - tConInfo.srWindow.Top ) + 1
- SetConsoleScreenBufferSize( hCon , type(ConWid , ConHei) )
- dim as integer BuffWid = 16, BuffHei = 23, iWritten = 0
- dim as ushort ptr pwConBuff
- pwConBuff = callocate( sizeof(ushort)*BuffWid )
- dim as double Timing1 = timer
- for I as integer = 0 to 2^8-1
- for Y as integer = 0 to BuffHei-1
- for X as integer = 0 to BuffWid-1
- pwConBuff[X] = asc("A") + ( asc("F") shl 8 )
- WriteConsoleOutputCharacter( hCon , _
- cast(zstring ptr, pwConBuff) , BuffWid*2 , type(1,Y+1) , @iWritten )
- next X
- next Y
- next I
- Timing1 = (timer-Timing1)*1000
- dim as CHAR_INFO ptr pConBuff
- pConBuff = callocate( sizeof(CHAR_INFO)*BuffWid*BuffHei*2 )
- memset( pConBuff , &h07 , sizeof(CHAR_INFO)*BuffWid*BuffHei*2 )
- dim as double Timing2 = timer
- for I as integer = 0 to 2^8-1
- var pTemp = pConBuff
- for Y as integer = 0 to BuffHei-1
- for X as integer = 0 to BuffWid-1
- pTemp[0].Char.UnicodeChar = asc("a")
- pTemp[1].Char.UnicodeChar = asc("f")
- pTemp += 2
- next X
- next Y
- dim as SMALL_RECT tRect = type( 1 , 1 ,BuffWid*2 + 1 , BuffHei + 1 )
- WriteConsoleOutput( hCon , pConBuff , type(BuffWid*2,BuffHei) , type(0,0) , @tRect )
- next I
- Timing2 = (timer-Timing2)*1000
- locate 11,35
- printf(!"WriteConsoleOutputCharacter = %f ms",Timing1/(2^8))
- locate 13,35
- printf(!"WriteConsoleOutput = %f ms\r\n",Timing2/(2^8))
- sleep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement