When you say "flexed" do you mean continuously flexed back and forth, or just simply no longer flat?
If the latter, use the idea shown in the state change detect example in the ide, to detect when it stops being flat and again when it's back to being flat. Use millis() to log the time at which both of those changes occur.