commit cfb07ff6d0a6ddee0695e4e3e454a463b699f891
parent ed0d3d01e15f02b89d8f2c99ab6e49fea929ddaf
Author: fundamental <[email protected]>
Date: Thu, 18 Dec 2014 23:19:38 -0500
Test: Split Out Instrument XML Load Time
Diffstat:
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/Tests/InstrumentStats.cpp b/src/Tests/InstrumentStats.cpp
@@ -67,10 +67,18 @@ void setup() {
p = new Part(alloc, µtonal, &fft);
}
-void load(string s)
+void xml(string s)
{
double t_on = tic();
p->loadXMLinstrument(s.c_str());
+ double t_off = toc();
+ if(mode == MODE_PROFILE)
+ printf("%f, ", t_off - t_on);
+}
+
+void load()
+{
+ double t_on = tic();
p->applyparameters();
p->initialize_rt();
double t_off = toc();
@@ -127,9 +135,10 @@ int main(int argc, char **argv)
return 1;
}
- mode = MODE_TEST;
+ mode = MODE_PROFILE;
setup();
- load(argv[1]);
+ xml(argv[1]);
+ load();
noteOn();
speed();
noteOff();