I tried to redirect the output of the time command, but I couldn't:
$time ls > filename
you can redirect the time output using,
(time ls) &> file
Because you need to take (time ls) as a single command so you can use braces.