#include <string.h>
#include <dlfcn.h>
#include <glib.h>
+#include <sys/time.h>
#include <tzplatform_config.h>
#include "media-util.h"
#define PATH_PLUGIN_LIB PATH_LIBDIR"/libmedia-content-plugin.so"
GMainLoop * mainloop = NULL;
+struct timeval start_time, end_time;
int (*svc_check_db) (sqlite3 * handle, uid_t uid);
int (*svc_get_storage_id) (sqlite3 * handle, const char *path, char *storage_id, uid_t uid);
void callback(media_request_result_s * result, void *user_data)
{
+ long long ms_time = 0;
+
if (result->result != MEDIA_REQUEST_SCAN_PARTIAL) {
- printf("db updating done\n");
+ gettimeofday(&end_time, NULL);
+ ms_time = (end_time.tv_sec * 1000LL + end_time.tv_usec / 1000) - (start_time.tv_sec * 1000LL + start_time.tv_usec/ 1000);
+
+ printf("db updating done. Time [%lld]\n", ms_time);
g_main_loop_quit(mainloop);
}
}
if (ret < 0)
return -1;
+ gettimeofday(&start_time, NULL);
return media_directory_scanning_async(path, storage_id, is_recursive, callback, NULL, tzplatform_getuid(TZ_USER_NAME));
}