Kartoffel, you're right about this point.
Yashas, of course you can do it like this, but it very unusual and even does not clearly express what you intend to do. A clearer approach without malloc:
To the crash: I do not understand why you post about a script crash but conceal the error message from us. Please note that the while loop while never gets executed as the memory area SpeedRun_Time points to is zero, unless you have intialized it to something else somehwere else.