<s> import rospy <EOL> import time <EOL> import actionlib <EOL> from basics . msg import TimerAction , TimerGoal , TimerResult <EOL> def do_timer ( goal ) : <EOL> start_time = time . time ( ) <EOL> time . sleep ( goal . time_to_wait . to_sec ( ) ) <EOL> result = TimerResult ( ) <EOL> result . time_elapsed = rospy . Duration . from_sec ( time . time ( ) - start_time ) <EOL> result . updates_sent = <NUM_LIT:0> <EOL> server . set_succeeded ( result ) <EOL> rospy . init_node ( '<STR_LIT>' ) <EOL> server = actionlib . SimpleActionServer ( '<STR_LIT>' , TimerAction , do_timer , False ) <EOL> server . start ( ) <EOL> rospy . spin ( ) </s>
