You should have a variable that stores the orientation of your bot from the previous loop through your odometry code. You want to initialize the variable before all your code and set it to 0. Something like this:
double prevAngle = 0;
The change in angle is the current angle minus the previous angle
dAngle = angle - prevAngle;
Note: you should declare your angle outside of your odom loop because you most likely want to be using your angle variable in other places for motion control.