From 219dfc0e8ed3c8a6083af3859de6db940e12f569 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Wed, 13 Feb 2008 22:41:55 +0100 Subject: [PATCH] Added profiling to the test clients. --- clients/test.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clients/test.c b/clients/test.c index cf4bc4c..34f0779 100644 --- a/clients/test.c +++ b/clients/test.c @@ -1,15 +1,21 @@ #include #include #include +#include +#include #include #include +#include int done; +double btime; void authcallback(int err, wchar_t *reason, void *data) { + printf("auth: %f\n", ntime() - btime); printf("Logged in: %i\n", err); + exit(0); dc_queuecmd(NULL, NULL, L"quit", NULL); } @@ -19,7 +25,9 @@ int main(int argc, char **argv) int fd; struct dc_response *resp; + btime = ntime(); dc_init(); + printf("init: %f\n", ntime() - btime); fd = dc_connect(NULL); done = 0; while(!done) @@ -41,6 +49,7 @@ int main(int argc, char **argv) { if(!wcscmp(resp->cmdname, L".connect")) { + printf("conn: %f\n", ntime() - btime); printf("Connected: %i\n", resp->code); if(resp->code == 201) dc_loginasync(NULL, 1, NULL, authcallback, NULL); @@ -48,6 +57,8 @@ int main(int argc, char **argv) dc_freeresp(resp); } } + printf("fini: %f\n", ntime() - btime); dc_cleanup(); + printf("exit: %f\n", ntime() - btime); return(0); } -- 2.11.0