Query: Save a Timestamp. HOW?

61 views
Skip to first unread message

@TiddlyTweeter

unread,
Mar 6, 2018, 9:01:55 AM3/6/18
to TiddlyWiki
I'm wondering if the value of the <<now>> macro can be SAVED to a State Tiddler at the moment it is run?

Is that possible?

Any help/tips appreciated.

@TiddlyTweeter


Jed Carty

unread,
Mar 6, 2018, 9:16:56 AM3/6/18
to TiddlyWiki
This works:

<$button>
CLICK!!
<$action-setfield bob=<
<now>>/>
</$button>

If you mean how to save it without the button than that means it has to change a tiddler as a side effect of rendering which is one of the things tiddlywiki avoids doing.

If you are trying to use this to test how long it takes to render a tiddler than there may be better ways to do it, like rendering it into a fake dom node and using javascript to check the time difference.

@TiddlyTweeter

unread,
Mar 6, 2018, 9:53:55 AM3/6/18
to TiddlyWiki
Thanks Jed. That is really helpful example and information.

Yes, I was hoping to use it to time a complex Tiddler render. But I can use the button for another case, so its still useful.

I'll look at the fake dom route, though probably beyond my competence.

Best wishes
Josiah

Thomas Elmiger

unread,
Mar 6, 2018, 12:35:59 PM3/6/18
to TiddlyWiki
Hi Josiah,

What exactly are you trying to achieve?

Maybe I have some interesting but complex macros from my Reminders for ToDoNow.

Basically they render a list, if a given date (from a field) is in the past.

Cheers
Thomas

@TiddlyTweeter

unread,
Mar 6, 2018, 1:09:19 PM3/6/18
to TiddlyWiki
Hi Thomas

I'm working with long sequences of complex regular expressions in one Tiddler. The issue is that sometimes I need to optimise one or two of them that are slowing render. But unless I can insert a timer that records the time at a given point I have no idea which of the regular expressions are inefficient. This makes development overly complicated. Without it I have to, one-by-one, test the regex. Fine if you have 3. Unworkable if you have 25.

My BEST scenario would be able to insert a timestamp before and after the regular expressions I think are the problem to isolate the issues (in render). It is NOT important if that saving of a Timestamp is itself an overhead, it can be adjusted for. And, in some ways I think it would be better saved to a separate State Tiddler rather than a field, if you grasp what I mean.

Please ask if anything is unclear or you need examples.

Best wishes
Josiah

Thomas Elmiger

unread,
Mar 6, 2018, 1:24:10 PM3/6/18
to TiddlyWiki
In this case, I would try to modify the regex engine to log a timestamp in the browser console after each run … that would not require much JS knowledge I guess.

Good luck!
Thomas

@TiddlyTweeter

unread,
Mar 6, 2018, 1:31:03 PM3/6/18
to TiddlyWiki
Thanks Thomas

Your conclusion kinda reflects what Jed said before.

So I will look more at what using console tools can do.

Best
Josiah
Reply all
Reply to author
Forward
0 new messages