slightly improve efficiency of sampling interrupt