The program is a middleware between a database and application. For each database access I most calculate the time length in milliseconds. The example bellow is using TDateTime from Builder library. I must, as far as possible, only use standard c++ libraries.
AnsiString TimeInMilliseconds(TDateTime t) { Word Hour, Min, Sec, MSec; DecodeTime(t, Hour, Min, Sec, MSec); long ms = MSec + Sec * 1000 + Min * 1000 * 60 + Hour * 1000 * 60 * 60; return IntToStr(ms); }
// computing times
TDateTime SelectStart = Now();
sql_manipulation_statement();
TDateTime SelectEnd = Now();