Nr31s Posted July 6, 2007 Share Posted July 6, 2007 Hi, have been search in the forum but i cannot find anything about using miliseconds in a clock or similar... My problem is to create a NAMEFILE based on day, month, year, hour, minute, second.... and i have to use one more (milisecond) but i don't have a clue how to get the milisecond Can someone help me!!!! :"> Link to comment Share on other sites More sharing options...
James Posted July 6, 2007 Share Posted July 6, 2007 Look at time conversion in my signature. That should show you how to work it out. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Toady Posted July 6, 2007 Share Posted July 6, 2007 (edited) Timer that displays milliseconds... $sec = @SEC While $sec <> @SEC WEnd $mill = TimerInit() ;syncs millicond with current time While 1 $sec = @SEC ToolTip(@hour & ":" & @MIN & ":" & @SEC & ":" & Round(TimerDiff($mill),0)) If @SEC > $sec Or TimerDiff($mill) > 1000 Then $mill = TimerInit() WEnd Edited July 6, 2007 by Toady www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 6, 2007 Share Posted July 6, 2007 Hi, Func _MSec() Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort') DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime)) $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8)) $stSystemTime = 0 Return $sMilliSeconds EndFunc ;==>_MSec So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 6, 2007 Share Posted July 6, 2007 Hi, Func _MSec() Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort') DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime)) $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8)) $stSystemTime = 0 Return $sMilliSeconds EndFunc ;==>_MSecoÝ÷ Ù*%¢xz¿ªê-xØ{}ÇiÛh¦ëb¶)Úué¨jëh×6#include <array.au3> Dim $avTimes[21] For $t = 1 To 20 $avTimes[$t] = @HOUR & ":" & @MIN & ":" & @SEC & "." & _MSec() Sleep(1) ; Without Sleep() all the times are the same! Next _ArrayDisplay($avTimes, "Time Test") Func _MSec() Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort') DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime)) $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8)) $stSystemTime = 0 Return $sMilliSeconds EndFunc ;==>_MSec Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Runite Posted July 6, 2007 Share Posted July 6, 2007 (edited) Couldn't you just take 1000 * seconds? That is, if AutoIt allows math :/ Something like this: $secs = InputBox("Seconds", "Input seconds:", " ") $millis = $secs * 1000 That's just the variables... Anyone could do that, but it could give some ideas? Lol. Good luck. Edited July 6, 2007 by Runite Link to comment Share on other sites More sharing options...
Paulie Posted July 6, 2007 Share Posted July 6, 2007 Couldn't you just take 1000 * seconds? That is, if AutoIt allows math :/ Something like this: $secs = InputBox("Seconds", "Input seconds:", " ") $millis = $secs * 1000 That's just the variables... Anyone could do that, but it could give some ideas? Lol. Good luck.That is exactly how you calculate a millisecond in relation to a second. But I believe the original poster wanted the current time to the millisecond, if i understand correctly. Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 6, 2007 Share Posted July 6, 2007 Couldn't you just take 1000 * seconds? That is, if AutoIt allows math :/ Something like this: $secs = InputBox("Seconds", "Input seconds:", " ") $millis = $secs * 1000 That's just the variables... Anyone could do that, but it could give some ideas? Lol. Good luck. Read the posts and understand what to goal is. If that's all you want just do _TimeToTicks(). But this topic is about getting the time down to the millisecond. Which th.meger's function does quite nicely. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Toady Posted July 6, 2007 Share Posted July 6, 2007 Yes, my post worked fine. Yet people still post.... www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 6, 2007 Share Posted July 6, 2007 Yes, my post worked fine. Yet people still post....No, I don't think it quite did. Your script depends on waiting for the rollover of @SEC to sync, which means it takes a minimum average of 500msec to run. If you run my demo of th.meger's script and comment out the sleep, you'll see he can get at least 20 executions done in less than a millisec. Your version would be useless to time-tag mulltiple events that happened in less than a second. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Toady Posted July 6, 2007 Share Posted July 6, 2007 No, I don't think it quite did. Your script depends on waiting for the rollover of @SEC to sync, which means it takes a minimum average of 500msec to run. If you run my demo of th.meger's script and comment out the sleep, you'll see he can get at least 20 executions done in less than a millisec. Your version would be useless to time-tag mulltiple events that happened in less than a second. No. But nice guess. www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
Nr31s Posted July 10, 2007 Author Share Posted July 10, 2007 Thats what i want PsaltyDS... it really works 100% thank you for all... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now