You make the arduino send a message through the serial port when it is time to run the processing function.
Processing looks at the serial port and calls the function when it sees the message.
You make the arduino send a message through the serial port when it is time to run the processing function.
Processing looks at the serial port and calls the function when it sees the message.