The multigap resistive plate chamber as a time-of-flight detector