(λ. borkdude) on Nostr: Wanna know how long your #babashka or #clojure process has been running? ...
Wanna know how long your #babashka or #clojure process has been running?
(Thread/sleep 1000)
(def started (-> (java.lang.ProcessHandle/current) .info .startInstant .get))
(prn
(-> (java.time.Duration/between
started
(java.time.Instant/now))
(.toMillis))) ;; 1034ms
Published at
2024-11-26 16:55:21Event JSON
{
"id": "9a0ae23b07baeb5e8699a61f45ca4a826e6d76e5d0b3fb754a23c03c735c4a43",
"pubkey": "c4ef83416f079257f5390f7d55a65e684d1b498d196e0e71bb8b90e21a820e07",
"created_at": 1732640121,
"kind": 1,
"tags": [
[
"t",
"babashka"
],
[
"t",
"clojure"
],
[
"imeta",
"url https://files.mastodon.social/media_attachments/files/113/550/302/870/284/784/original/f8abc4d8d460b23e.png",
"m image/png",
"dim 1182x370",
"blurhash UbBpU~oej[j@^-axf6j[%5axa|fPaRfifkaz"
],
[
"proxy",
"https://mastodon.social/users/borkdude/statuses/113550302976042512",
"activitypub"
]
],
"content": "Wanna know how long your #babashka or #clojure process has been running?\n\n(Thread/sleep 1000)\n\n(def started (-\u003e (java.lang.ProcessHandle/current) .info .startInstant .get))\n\n(prn\n\n (-\u003e (java.time.Duration/between\n\n started\n\n (java.time.Instant/now))\n\n (.toMillis))) ;; 1034ms\n\nhttps://files.mastodon.social/media_attachments/files/113/550/302/870/284/784/original/f8abc4d8d460b23e.png",
"sig": "f4a4fa4d5a228ef17828e1f2af77121eadc0aadfe60b039c6297db1493e13b859f0fe48d93c985c7f1697a9f8666ca35ff0835885e2315d39cdcbd2c95d93b62"
}