Use VFS method xCurrentTimeInt64 instead of xCurrentTime when it is available.

Provide an implementation of xCurrentTimeInt64 for os_unix.c.

FossilOrigin-Name: ab77b3ae6da3370d8bc3b2c9c0edc723b69f5a95
This commit is contained in:
drh
2010-05-03 14:32:30 +00:00
parent e8e1c9d50e
commit b7e8ea2015
9 changed files with 75 additions and 69 deletions
+4 -10
View File
@@ -377,9 +377,7 @@ static int sqlite3Step(Vdbe *p){
#ifndef SQLITE_OMIT_TRACE
if( db->xProfile && !db->init.busy ){
double rNow;
sqlite3OsCurrentTime(db->pVfs, &rNow);
p->startTime = (u64)((rNow - (int)rNow)*3600.0*24.0*1000000000.0);
sqlite3OsCurrentTimeInt64(db->pVfs, &p->startTime);
}
#endif
@@ -400,13 +398,9 @@ static int sqlite3Step(Vdbe *p){
/* Invoke the profile callback if there is one
*/
if( rc!=SQLITE_ROW && db->xProfile && !db->init.busy && p->zSql ){
double rNow;
u64 elapseTime;
sqlite3OsCurrentTime(db->pVfs, &rNow);
elapseTime = (u64)((rNow - (int)rNow)*3600.0*24.0*1000000000.0);
elapseTime -= p->startTime;
db->xProfile(db->pProfileArg, p->zSql, elapseTime);
sqlite3_int64 iNow;
sqlite3OsCurrentTimeInt64(db->pVfs, &iNow);
db->xProfile(db->pProfileArg, p->zSql, iNow - p->startTime);
}
#endif