aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-06-27 14:27:10 +0000
committerrowanbeentje <rowan@beent.je>2009-06-27 14:27:10 +0000
commitcd7bc33e901ca84efa53dd5a26c837b5918a3b10 (patch)
tree9ea82f1f36ac3ecf96a3f34149266ca5bf0f842f /Source/CustomQuery.m
parentdd93ba60cc062ce4a733338ff993acf4db7cc537 (diff)
downloadsequelpro-cd7bc33e901ca84efa53dd5a26c837b5918a3b10.tar.gz
sequelpro-cd7bc33e901ca84efa53dd5a26c837b5918a3b10.tar.bz2
sequelpro-cd7bc33e901ca84efa53dd5a26c837b5918a3b10.zip
Improve custom query timing and display:
- Amend timing using clock() to timing based on mach_absolute_time() (see revision comment on Google code) - Ensure the time returned is for the requested query and not subsequent helper queries - Use NSNumberFormatter to return a localised "< 0.1 ms" rather than the hardcoded Euro-style "< 0,1 ms"
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 6bb65056..0b18848c 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -396,7 +396,7 @@
NSMutableString *errors = [NSMutableString string];
int i, totalQueriesRun = 0, totalAffectedRows = 0;
- float executionTime = 0;
+ double executionTime = 0;
int firstErrorOccuredInQuery = -1;
BOOL suppressErrorSheet = NO;
BOOL tableListNeedsReload = NO;
@@ -593,26 +593,26 @@
if (totalAffectedRows==1) {
[affectedRowsText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"1 row affected in total, by %i queries taking %@", @"text showing one row has been affected by multiple queries"),
totalQueriesRun,
- [NSString stringForTimeInterval:executionTime intervalInClocks:YES]
+ [NSString stringForTimeInterval:executionTime]
]];
} else {
[affectedRowsText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"%i rows affected in total, by %i queries taking %@", @"text showing how many rows have been affected by multiple queries"),
totalAffectedRows,
totalQueriesRun,
- [NSString stringForTimeInterval:executionTime intervalInClocks:YES]
+ [NSString stringForTimeInterval:executionTime]
]];
}
} else {
if (totalAffectedRows==1) {
[affectedRowsText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"1 row affected, taking %@", @"text showing one row has been affected by a single query"),
- [NSString stringForTimeInterval:executionTime intervalInClocks:YES]
+ [NSString stringForTimeInterval:executionTime]
]];
} else {
[affectedRowsText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"%i rows affected, taking %@", @"text showing how many rows have been affected by a single query"),
totalAffectedRows,
- [NSString stringForTimeInterval:executionTime intervalInClocks:YES]
+ [NSString stringForTimeInterval:executionTime]
]];
}