#+title: lisp timestamp In [[file:20200713103540-emacs_lisp.org][Emacs Lisp]] at least, times are stored as lists like so: #+begin_src emacs-lisp '(24814 288) #+end_src in the form of =(ticks . hz)=. If =hz= is =1000000000= (that's $1^{10}$), this represents a nanosecond resolution clock. Alternatively, if it's a list of four elements, like so: #+begin_src emacs-lisp '(24814 232 507836 148000) #+end_src This represents =(high low micro pico)=, which, in seconds, can be represented as: $high * 2^{16} + low + micro * 10^{-6} + pico * 10^{-12}$ or, as an [[file:20210307153354-s_expression.org][s-expression]]: #+begin_src emacs-lisp (defun calc-time (high low micro pico) (+ (* high (expt 2 16)) low (* micro (expt 10 -6)) (* pico (expt 10 -12)))) (let* ((now (current-time)) (float-time-from-now (float-time now)) (calc-time-from-now (apply 'calc-time now))) (message "float-time\t%s\ncalc-time\t%s" float-time-from-now calc-time-from-now)) #+end_src #+RESULTS: : float-time 1626211147.6277604 : calc-time 1626211147.6277604