What literary device is used in the phrase “lockers slammed shut like a rhythmic beat?

The literary device used in the phrase "lockers slammed shut like a rhythmic beat" is simile. It compares the action of lockers slamming shut to the rhythmic beat of music.