mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-15 03:01:09 +08:00
d92b9d3c9e
BEWARE: the backend will be compiled. the backend will NOT be invoked, yet. the backend CANNOT be invoked, yet, because it is NOT yet integrated into the new initialization/startup environment of the slapd server.
36 lines
708 B
C
36 lines
708 B
C
/* timing.c - timing bdb2 backend */
|
|
|
|
#include "portable.h"
|
|
|
|
#include <stdio.h>
|
|
#include <sys/time.h>
|
|
#include <unistd.h>
|
|
|
|
#include <ac/string.h>
|
|
|
|
#include "slap.h"
|
|
#include "back-bdb2.h"
|
|
|
|
|
|
int bdb2i_do_timing = 0;
|
|
|
|
|
|
char *
|
|
bdb2i_elapsed( struct timeval firsttime, struct timeval secondtime )
|
|
{
|
|
long int elapsedmicrosec, elapsedsec;
|
|
char elapsed_string[BUFSIZ];
|
|
|
|
elapsedsec = secondtime.tv_sec - firsttime.tv_sec;
|
|
elapsedmicrosec = secondtime.tv_usec - firsttime.tv_usec;
|
|
if(elapsedmicrosec < 0) {
|
|
elapsedmicrosec += 1000000;
|
|
elapsedsec -= 1;
|
|
}
|
|
|
|
sprintf( elapsed_string, "%ld.%.6ld", elapsedsec, elapsedmicrosec );
|
|
return( strdup( elapsed_string ));
|
|
}
|
|
|
|
|