I keep getting zero as my time. I need to calculate the total time and the average time for searching though the hash table. Can someone please tell me what i am doing wrong?
void HashTable_chaining::SearchChainingHT(vector<string> QueryArray)
{
clock_t start, stop, time = 0;
int i = 0;
while(i != QueryArray.size())
{
start = clock();
find(QueryArray[i]);
stop = clock();
time += stop - start;
i++;
}
time = (double)(time/CLOCKS_PER_SEC)*1000;
cout << "\nThe total time for Search Chaining was " << time << "\nThe average time was " << time/QueryArray.size();
}