extracting frame rate

Hello guys,
I havent experimented anytime before on extracting the frame rate while working in OpenGL. I have a little idea of how to get frame rate in windows environment using Microsoft Visual C++, but no idea of how to get it in unix environment. Can anyone give me a snippet of code and the header files I need to include to get the frame rate. Any help is deeply appreciated.