source: trunk/third/bonobo-activation/server/test-performance.c @ 18563

Revision 18563, 866 bytes checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18562, which included commits to RCS files with non-trunk default branches.
Line 
1#include <config.h>
2#include <stdio.h>
3#include <string.h>
4#include <stdlib.h>
5#include <glib.h>
6#include "server.h"
7
8static GTimer *timer;
9
10static void
11test_server_info_load (void)
12{
13        int i;
14        char *dirs [] = { SERVERINFODIR, NULL };
15        Bonobo_ServerInfoList servers;
16        GHashTable *hash = NULL;
17
18        fprintf (stderr, "Testing server info load ...");
19
20        g_timer_start (timer);
21        for (i = 0; i < 10; i++)
22                bonobo_server_info_load (dirs, &servers, &hash,
23                                         bonobo_activation_hostname_get ());
24
25        fprintf (stderr, " %g(ms)\n",
26                 g_timer_elapsed (timer, NULL) * 1000.0 / 10);
27}
28
29int
30main (int argc, char *argv[])
31{
32        free (malloc (8));
33
34        timer = g_timer_new ();
35        g_timer_start (timer);
36
37        add_initial_locales ();
38
39        test_server_info_load ();
40
41        if (g_getenv ("_MEMPROF_SOCKET")) {
42                g_warning ("Waiting for memprof\n");
43                g_main_context_iteration (NULL, TRUE);
44        }
45
46        return 0;
47}
Note: See TracBrowser for help on using the repository browser.