thank you for reply, but problem is , i have a camera , this is gives data 30 Hz sampling frequency, means 30fps, means 30 samples per second, time difference between each sample is 1/30 = 0.033 sec. now i want to calculate time difference between each sample as vi run for camera gives data. for that i want previous time of sample and current time of sample .