How to show milliseconds?

Yhang

New member
Want to display milliseconds after the second, how to achieve it?
 

Attachments

  • 微信截图_20230211110737.png
    微信截图_20230211110737.png
    162.2 KB · Views: 8

Dimlos

Well-known member
Milliseconds can be obtained with a shell script.
 

Attachments

  • Macro.jpg
    Macro.jpg
    346.2 KB · Views: 15
  • date_display.macro
    1.5 KB · Views: 6

Yhang

New member
Milliseconds can be obtained with a shell script.
Hello, I tried it, you can display the milliseconds, but just display it in the auxiliary program, how to extract the floating text?
 

Attachments

  • 微信截图_20230211125925.png
    微信截图_20230211125925.png
    190.3 KB · Views: 5

Dimlos

Well-known member
You can specify local variables from the red circle in the floating text dialog.
 

Attachments

  • FloatingText.jpg
    FloatingText.jpg
    188 KB · Views: 5

Yhang

New member
You can specify local variables from the red circle in the floating text dialog.
Thank you, this can be displayed, but he is a fixed time displayed, can it display the real -time time? The effect of beating per second
 

Dimlos

Well-known member
No, I can't. I was dimly aware that that is what you wanted to do.
It just shows the time at the moment it was retrieved by the script.
 

Dimlos

Well-known member
I thought it could not be done, but it can be done, but there are a few things to note.

1.After importing the macro, re-set the WHILE / DO conditions. (This Macro)
2.Test action Floating Text and move it to a place where it will never be disturbed. (Note that once the macro starts moving, you will not be able to move it.)
3.Execute with Test Macro (Disable Macro to stop)

If it works, the display will be rewritten at high speed, it may flicker if the performance of the terminal is low.
 

Attachments

  • Macro.jpg
    Macro.jpg
    279.4 KB · Views: 11
  • time_display.macro
    2.4 KB · Views: 5

Dimlos

Well-known member
It is rare for MacroDroid to rewrite the display in less than 1 second and not hang up, if you have time, please try it.
(Please back up before running it, as it might hang up)
 

Dimlos

Well-known member
This is a video of the operation.
 

Yhang

New member
This is a video of the operation.
Yes, it can be displayed, but the screen will be a little stuck, but the desired effect has been achieved, thank you very much.
 

Dm114

Well-known member
Hello, I tried it, you can display the milliseconds, but just display it in the auxiliary program, how to extract the floating text?
Store the Shell date command in an appropriate format (such as date +%H:%M:%S.%3N or date +.3N to only get ms) in a String variable and then use/display this variable as desired
 
Last edited:

Dimlos

Well-known member
@Dm114 Is that not the case with the screenshots and macros I am presenting?

@Yhang method is not wrong, I didn't know, but if you specify the hours:minutes:seconds directly, the floating text value will move.
From this, if we have magic text for milliseconds, we should be able to display milliseconds without resorting to shell scripts.
 

Attachments

  • floating text.jpg
    floating text.jpg
    341.9 KB · Views: 5

Dm114

Well-known member
@Dm114 Is that not the case with the screenshots and macros I am presenting?

@Yhang method is not wrong, I didn't know, but if you specify the hours:minutes:seconds directly, the floating text value will move.
From this, if we have magic text for milliseconds, we should be able to display milliseconds without resorting to shell scripts.
Yes, you're right: it's the same command as yours but I was surprised by Yhang's question and think he didn't understand how it works.

Except to name a file, I don't know how displaying ms could make sense as this information is not accurate at all if taking into account the time to launch MD command and display or store it... :confused:
 

Yhang

New member
@Dm114 Is that not the case with the screenshots and macros I am presenting?

@Yhang method is not wrong, I didn't know, but if you specify the hours:minutes:seconds directly, the floating text value will move.
From this, if we have magic text for milliseconds, we should be able to display milliseconds without resorting to shell scripts.
It would be better if milliseconds were added to the built-in software, and the degree of freedom would be higher, allowing users to choose whether to display or not.
 

Dm114

Well-known member
It would be better if milliseconds were added to the built-in software, and the degree of freedom would be higher, allowing users to choose whether to display or not.
I'm not a Unix specialist but I guess it's not possible as ms are probably stored apart from date-time which is stored in seconds. ms couldn't fit if stored as an integer, nor decimal value.
 
Top