CyDelay() uses a timed loop just "burning" CPU power. Not what you want. See description in "System Reference Guide".
You should set up a timer with an interrupt and maintain an internal counter yourself. Granularity may be as low as one millisecond
You cannot convert that directly, since there is no corresponding millis() function. Your Ardiono example uses a function that returns a time value (milli seconds since startup), and uses that to find out how many time has passed. CyDelay() waits for the specified time, and has no return value - thats why you get a compile error.
would you like to share the sample code for that....?
"would you like to share the sample code for that....?" Its not a sample code, it is a simple code.
extern volatile uint32 msCounter;
Have an interrupt connected to a 1 kHz clock