If you use OpenCV 2.4.3.1 or newer you can enable built-in fps-meter in application layout. See tutorial-1 for more detailes.
If you want to get precise processing time you can use cv::getTickCount function in C++ and Core.getTickCount() in Java.
In most cases the best solution is to measure processing time only. Camera performance may differ from frame to frame and depends on a lot of parameters, i.e. lightning.