#include <gresolv/gresolv.h>
-static GMainLoop *main_loop = NULL;
+static GTimer *timer;
+
+static GMainLoop *main_loop;
static void resolv_debug(const char *str, void *data)
{
static void resolv_result(GResolvResultStatus status,
char **results, gpointer user_data)
{
+ gdouble elapsed;
int i;
+ elapsed = g_timer_elapsed(timer, NULL);
+
+ g_print("elapse: %f seconds\n", elapsed);
+
g_print("status: %d\n", status);
if (results != NULL) {
} else
g_resolv_add_nameserver(resolv, "127.0.0.1", 53, 0);
+ timer = g_timer_new();
+
g_resolv_lookup_hostname(resolv, argv[1], resolv_result, NULL);
memset(&sa, 0, sizeof(sa));
g_main_loop_run(main_loop);
+ g_timer_destroy(timer);
+
g_resolv_unref(resolv);
g_main_loop_unref(main_loop);