Change Clip Duration Programmatically...

I was wondering how can I change a clip duration programmatically?
I'm adding (programmatically) a Text clip and by default lasts 5 seconds, but I would like to be able to change programmatically the length.
I'm almost sure it is very easy to do, but I have not been have to find the right function.
Thanks in advance.
E.
I'm adding (programmatically) a Text clip and by default lasts 5 seconds, but I would like to be able to change programmatically the length.
I'm almost sure it is very easy to do, but I have not been have to find the right function.
Thanks in advance.
E.