ts will be zero (Well, at least now - I left that undefined by accident it seems like :P) when lastline isn't set yet. (Right after the mode is set.)