Calculating delta time

I seem to have fixed the problem. My character positions were ints so I changed them to floats, and I changed my time variables from longs to floats too. I'm not sure why this fixed the problem though.