Skip to content

Instantly share code, notes, and snippets.

@redaready
Created March 20, 2011 09:18
Show Gist options
  • Select an option

  • Save redaready/878224 to your computer and use it in GitHub Desktop.

Select an option

Save redaready/878224 to your computer and use it in GitHub Desktop.
#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);
}
@G-WAN
Copy link

G-WAN commented Mar 8, 2012

I have seen this code and I rewrote it slightly, see this version:

https://gist.github.com/2001619

Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment