From e1af7c62ee26b33be9ced00561bda8873ada8fc6 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 17 Jun 2009 21:59:45 +0000 Subject: =?UTF-8?q?=E2=80=A2=20some=20improvement=20to=20speed=20up=20quer?= =?UTF-8?q?yString:=20-=20caching=20of=20delegate=20&&=20respondsToSelecto?= =?UTF-8?q?r=20-=20use=20clock()=20to=20calculate=20query's=20execution=20?= =?UTF-8?q?time=20=E2=80=A2=20converting=20to=20cString:=20if=20utf8=20enc?= =?UTF-8?q?oding=20make=20usage=20of=20UTF8String=20=E2=80=A2=20added=20to?= =?UTF-8?q?=20StringAddition=20to=20display=20=C2=B5s=20for=20a=20timeInte?= =?UTF-8?q?rvall?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPStringAdditions.m | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source/SPStringAdditions.m') diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m index def9ce56..da4380ff 100644 --- a/Source/SPStringAdditions.m +++ b/Source/SPStringAdditions.m @@ -80,6 +80,12 @@ [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; + if (timeInterval < 0.001) { + timeInterval = (timeInterval * 1000000); + [numberFormatter setFormat:@"#,##0 µs"]; + + return [numberFormatter stringFromNumber:[NSNumber numberWithFloat:timeInterval]]; + } if (timeInterval < 1) { timeInterval = (timeInterval * 1000); [numberFormatter setFormat:@"#,##0 ms"]; -- cgit v1.2.3