How to set the timeline curve animation length in C++?

Timeline created under blueprints comes with the Curve in which we can set the length.

But how to set this length if the timeline is created with C++?
I am trying to set the length to 3sec but the timeline don’t take any effect from: TL_UpdateCameraHeight->SetTimelineLength(3.0f);