You said "method," so I'm assuming you're using ObjC and Cocoa. You can use NSDate easily:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>NSTimeInterval t = [NSDate timeIntervalSinceReferenceDate];
<font color = brown>/* <font color = green>do</font> whatever you want to <font color = green>do</font> */</font>
t = [NSDate timeIntervalSinceReferenceDate] - t;
<font color = brown>/* So now t holds the elapsed time in seconds (as a <font color = green>double</font>) */</font>
</font>[/code]
If you are not using Cocoa, CFDate (in CoreFoundation) also has similar functionality.
Ali