X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=loadertest.cpp;h=9dc9074240af6b92853a887684585dfc71b520d9;hb=c5b741c83e804f1e438caca83565a76e254d0b94;hp=48bdac9574ed2bb4ff6dbe6206333359513e54d0;hpb=8216d8efc428dd336957433d743af5c4ac2d0d05;p=apitrace diff --git a/loadertest.cpp b/loadertest.cpp index 48bdac9..9dc9074 100644 --- a/loadertest.cpp +++ b/loadertest.cpp @@ -1,7 +1,33 @@ #include "trace_loader.hpp" +#include "os.hpp" #include + +static const double msecsInSec = 1000000; + +static void timeFrameFetch(Trace::Loader &loader, unsigned frameIdx) +{ + long long t1, t2; + std::vector frame; + + t1 = OS::GetTime(); + frame = loader.frame(frameIdx); + t2 = OS::GetTime(); + std::cout << "Time to fetch the frame[" + << frameIdx + << "] size " + << frame.size() + << " is = " + << (t2 - t1)/msecsInSec + << " secs "<