measuring angle using gyro sensor
You just need to perform discrete time integration. It's quite simple actually. The absolute simplest version goes something like this for each sample.


Collect the sample from your gyro

sample = gyro_sample;

Get the current time 

time = current_time;

Calculate the time elapsed since the last sample by differencing the time samples

delta_time = current_time - previous_time;

Multiply the sample and the time difference - this is your change in angle since the last sample

delta_angle = sample * delta_time;

Add this difference to your current angle

current_angle = current_angle + delta_angle;

Save the current time as previous time

previous_time = time;



You'll need to do this for each axis coming from the gyro. 

This all being said, and answering your question, there is a bit more. 

This will provide rather horrible results. The angle will drift very rapidly. You'll need to start with a known orientation and then you'll have an accurate orientation on the order of seconds. Additionally, if you're using Euler angles you'll run into issues with poles. To get more accurate results you'll need to implement some rather complex filtering. You haven't described your application though, so it's hard to say what you actually require. You might be able to scavenge some code from full IMU projects. Many of the IMUs on Sparkfun have example code.