diff options
author | comex | 2015-01-10 16:33:13 -0500 |
---|---|---|
committer | comex | 2015-01-10 16:33:13 -0500 |
commit | c15c71d9f02e7650fa7b87fc8cbe0f25ead2782c (patch) | |
tree | 115626b669f50033e83fbc9bd9dc06240205172f /test/test-substrate.cpp | |
parent | substrate (diff) | |
download | substitute-c15c71d9f02e7650fa7b87fc8cbe0f25ead2782c.tar.gz |
fixes
Diffstat (limited to 'test/test-substrate.cpp')
-rw-r--r-- | test/test-substrate.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/test/test-substrate.cpp b/test/test-substrate.cpp index f30918e..9cf50e8 100644 --- a/test/test-substrate.cpp +++ b/test/test-substrate.cpp @@ -11,13 +11,20 @@ int main() { MSImageRef im = MSGetImageByName(foundation); assert(im); - int (*f)(int); + int (*f)(int); + clock_t a = clock(); + MSHookSymbol(f, "_absolute_from_gregorian", im); + clock_t b = clock(); + printf("init: %ld\n", (long) (b - a)); + a = clock(); MSHookSymbol(f, "_absolute_from_gregorian", im); + b = clock(); + printf("spec: %ld\n", (long) (b - a)); assert(f(12345) < 0); - clock_t a = clock(); + a = clock(); MSHookSymbol(f, "_absolute_from_gregorian"); - clock_t b = clock(); - printf("%ld\n", (long) (b - a)); + b = clock(); + printf("gen: %ld\n", (long) (b - a)); assert(f(12345) < 0); } |