Created
March 20, 2011 09:18
-
-
Save redaready/878224 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "gwan.h" | |
| int main(int argc, char *argv[]) | |
| { | |
| int i,j; | |
| int table[1000][10]; | |
| char buffer[4]; | |
| xbuf_t *reply = get_reply(argv); | |
| u64 start = getus(); | |
| for(i=0;i<1000;i++) | |
| { | |
| for(j=0;j<10;j++) | |
| { | |
| table[i][j]=j+1; | |
| } | |
| } | |
| xbuf_xcat(reply, "<table>"); | |
| for(i=0;i<1000;i++) | |
| { | |
| xbuf_xcat(reply, "<tr>"); | |
| for(j=0;j<10;j++) | |
| { | |
| s_snprintf(buffer,100,"%d",table[i][j]); | |
| escape_html(buffer,buffer,100); | |
| xbuf_xcat(reply, "<td>%s</td>",buffer); | |
| } | |
| xbuf_xcat(reply, "</tr>"); | |
| } | |
| xbuf_xcat(reply, "</table>"); | |
| xbuf_xcat(reply, | |
| "<p>%d</p>", | |
| getus()-start); | |
| return(200); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have seen this code and I rewrote it slightly, see this version:
https://gist.github.com/2001619
Hope it helps.