you sure your echo statement is exactly as shown? It should print 55640, unless you misspelled your variable, or maybe forgot to put brackets around your math statement.
Try doing:
Code:
$time1=time();
$time2=time();
$result=$time2-$time1;
echo $result;
That should guarantee you the result you want. You shouldn't have to use typecasting (int) if you assigned your variables using the time() function, it will return an integer.