Programming Photoswitch right sight sensor

I am the programmer on my team, and I need help with programming the right sight sensor to get the rpm of a motor. I f you can send me a sample of one that would be really appreciated. Thanks!

You’ll want to use the Counter class. Specifically, Counter.getRate()](http://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/first/wpilibj/Counter.html#getRate--)

What would the getRate do?