I have written a program which would fetch file details and place them in the SQLite database. In this process i have observed two scenarios:
Scenario 1:
- Loop through each and every file and fill the file details(path) in to the database(sqlite3).
- While for each file encountered,keep a counter and print the same via std::cout. Time taken to execute this program:30mins
Scenario 2:
- Loop through each and every file and fill the file details(path) in to the database(sqlite3).
Time taken to execute this program:7mins
I am very unclear as of why just because of std::cout
,the time taken is 5 times more than that of not printing it?
Any pointers on this scenario is highly appreciated.Thanks a lot.
Regards, Ravi