Added barrier bench function for synchronization