interval and length are in ns and thus can somewhat easily overflow

changed to longs (which is the right thing on 64bit and wrong on 32
bit OSes). Similar problem in dealing with %d and %ld.

I would like to keep the same time base throughout (ns).

It's been so long since I programmed outside the kernel that I don't
remember how to expressly specify u32 and u64 types.