added time measurement for insert to db and query db