Hi Haoxian,
There isn't a function to do this but I think you could calculate it by using the yarn.GetRawYarnLength() function. This gives you the length along the yarn path. If you then calculated the distance between the first and last nodes in the yarn then I guess you could calculate the percentage crimp from those two things.