10 typedef unsigned long int rpmtime_t;
14 typedef struct rpmsw_s * rpmsw;
18 typedef struct rpmop_s * rpmop;
25 unsigned long long int ticks;
26 unsigned long int tocks[2];
31 * Cumulative statistics for an operation.
34 struct rpmsw_s begin; /*!< Starting time stamp. */
35 int count; /*!< Number of operations. */
36 size_t bytes; /*!< Number of bytes transferred. */
37 rpmtime_t usecs; /*!< Number of ticks. */
44 /** Return benchmark time stamp.
45 * @param *sw time stamp
46 * @return 0 on success
49 rpmsw rpmswNow(/*@returned@*/ rpmsw sw)
50 /*@globals internalState @*/
51 /*@modifies sw, internalState @*/;
53 /** Return benchmark time stamp difference.
54 * @param *end end time stamp
55 * @param *begin begin time stamp
56 * @return difference in micro-seconds
58 rpmtime_t rpmswDiff(/*@null@*/ rpmsw end, /*@null@*/ rpmsw begin)
61 /** Return benchmark time stamp overhead.
62 * @return overhead in micro-seconds
65 rpmtime_t rpmswInit(void)
66 /*@globals internalState @*/
67 /*@modifes internalState @*/;
71 * Enter timed operation.
72 * @param op operation statistics
75 int rpmswEnter(rpmop op)
76 /*@globals internalState @*/
77 /*@modifes op->count, op->begin, internalState @*/;
80 * Exit timed operation.
81 * @param op operation statistics
82 * @param rc per-operation data (e.g. bytes transferred)
85 int rpmswExit(rpmop op, ssize_t rc)
86 /*@globals internalState @*/
87 /*@modifes op-bytes, op->usecs, internalState @*/;
93 #endif /* H_RPMIO_INTERNAL */