how to implement timer's callback function in C under Linux
问题 I have searched the possible solution on many forums for several days but have no luck; ( I post my question here and your reply is greatly appreciated. IDEA: Use a script to control lights (in C under Linux) APPLICATION SCENARIO I have three lights: red, blue and green. The script has the schedules to control them. For example, From now in 10 seconds, turn on the red light for 2 seconds; From now in 15 seconds, turn on the blue light for 10 seconds; From now in 21 seconds, turn on the red