Order entities by meta data

I have some entities with a unixtime stamp as a metadata value.  I would like to sort these entities based off that metadata value.  How would this be done?

Example:  $entity->customtime = time();