It’s exactly that. Subtract the previous reading from the current, then divide it by the Time.deltaTime, but make sure you ONLY do that when Time is moving forward with enough speed to make stable results, given the accuracy of floating point.
Something like:
private float previous, current;
void Update()
{
// TODO: set current to new value here.
float deltaTime = Time.deltaTime;
if (deltaTime > 0.001f)
{
float deltaValue = current - previous;
float changeRate = deltaValue / deltaTime;
// TODO: use changeRate for your decision here
}
// age data
previous = current;
}
A common improvement to this is to use a low pass filter (Mathf.Lerp() can help you make a cheese one) to require more than a single frame out of range to trigger it.