How to measure spring constant