views:

409

answers:

1

I have question concerning a function I created. I would like to show the timeinterval in my console output.

-(void)MyTimeInterval:(id)sender
{
    NSDate *then = [NSDate date];

    NSDate *now = [NSDate date];

    NSTimeInterval interval = [now timeIntervalSinceDate:then];

    NSLog(@"let me see the timeinterval between now and then %d", interval);
}

Does anyone have an idea what I should use to see the interval in the console output. It's not %d... I don't think I'm doing something wrong here in my function ( could be wrong of course ) , so I'm guessing it must be %d.

+3  A: 

What you are looking for is %f. This is specifier to display a floating point number. NSTimeInterval is a floating point number with the unit being seconds

ennuikiller
yes thank you ..
jovany