set starttime [ns_time] # execute query set endtime [ns_time] set elapsedtime [expr $endtime - $starttime]