how can i measure mA if it is running on PWM?

Why not just calculate it? Say you are driving a resistor to the anode, cathode to ground.
You know the output is 5V (the pulse width may vary but the output is 0 or 5V), you know the forwad voltage drop of the LED, you know the resistor value.
Thus (5v- Vled)/R = current.

The current will be the same every time the pulse goes high, the only difference is how long the current is conducted, and that is determined by the pulse width.