]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/testgetdests.c
2 * CUPS cupsGetDests API test program for CUPS.
4 * Copyright 2017 by Apple Inc.
6 * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
10 * Include necessary headers...
19 * 'main()' - Loop calling cupsGetDests.
22 int /* O - Exit status */
25 int num_dests
; /* Number of destinations */
26 cups_dest_t
*dests
; /* Destinations */
27 struct timeval start
, end
; /* Start and stop time */
28 double secs
; /* Total seconds to run cupsGetDests */
33 gettimeofday(&start
, NULL
);
34 num_dests
= cupsGetDests(&dests
);
35 gettimeofday(&end
, NULL
);
36 secs
= end
.tv_sec
- start
.tv_sec
+ 0.000001 * (end
.tv_usec
- start
.tv_usec
);
38 printf("Found %d printers in %.3f seconds...\n", num_dests
, secs
);
40 cupsFreeDests(num_dests
, dests
);