Conditional display of taxonomy assignment

<?php $terms = get_the_terms( $post->ID , 'rec-year' ); 
if( !empty ($terms) ) echo 'timeframes:';?>

<?php $terms = get_the_terms( $post->ID , 'rec-year' ); 
if( !empty ($terms) ) {
                    foreach ( $terms as $term ) {
                        $term_link = get_term_link( $term, 'rec-year' );
                        if( is_wp_error( $term_link ) )
                        continue;
                    echo                    
                   ' | ' .'<a href="' . $term_link . '">'  .$term->name .'</a>' ;
                    } 
                }
                ?>