Lakhtin_V Active Member Licensed User Longtime User Apr 5, 2023 #1 Faced with the problem of displaying the time. For my task, it is necessary to accurately measure time intervals, the higher the accuracy, the better. I wanted to work with milliseconds. But I ran into the problem of how to get and analyze the exact time. Here is the code that gives strange results. Code: Copy Stime=DateTime.Now() ....... DateTime.TimeFormat="HH:mm:ss.sss" miliSec=STime Mod 1000 Log("Time " & DateTime.Time(STime) & " Signal " & STime & " MiliSec " & miliSec ) As a result, I get in the log window Why are the last three decimal places in seconds different from the original data?
Faced with the problem of displaying the time. For my task, it is necessary to accurately measure time intervals, the higher the accuracy, the better. I wanted to work with milliseconds. But I ran into the problem of how to get and analyze the exact time. Here is the code that gives strange results. Code: Copy Stime=DateTime.Now() ....... DateTime.TimeFormat="HH:mm:ss.sss" miliSec=STime Mod 1000 Log("Time " & DateTime.Time(STime) & " Signal " & STime & " MiliSec " & miliSec ) As a result, I get in the log window Why are the last three decimal places in seconds different from the original data?
OliverA Expert Licensed User Longtime User Apr 5, 2023 #2 Lakhtin_V said: DateTime.TimeFormat="HH:mm:ss.sss" Click to expand... Should be Code: Copy DateTime.TimeFormat="HH:mm:ss.SSS" Sources: B4A - Core SimpleDateFormat (Java Platform SE 7 ) Upvote 1
Lakhtin_V said: DateTime.TimeFormat="HH:mm:ss.sss" Click to expand... Should be Code: Copy DateTime.TimeFormat="HH:mm:ss.SSS" Sources: B4A - Core SimpleDateFormat (Java Platform SE 7 )