Re: Get milliseconds from time and construct time based on milliseconds

2024-05-29 Thread bauss via Digitalmars-d-learn
a solution to after looking at std.datetime. First question is how do I get the current time but in milliseconds? Second is how do I construct a time ex. systime or datetime based on milliseconds? Thanks Unixtime might be what you want: import std; import std.datetime; import std.stdio

Re: Get milliseconds from time and construct time based on milliseconds

2024-05-28 Thread Steven Schveighoffer via Digitalmars-d-learn
get the current time but in milliseconds? Second is how do I construct a time ex. systime or datetime based on milliseconds? Thanks Unixtime might be what you want: import std; import std.datetime; import std.stdio; void main() { // Get the current time in the UTC time zone

Re: Get milliseconds from time and construct time based on milliseconds

2024-05-28 Thread bauss via Digitalmars-d-learn
On Tuesday, 28 May 2024 at 18:29:17 UTC, Ferhat Kurtulmuş wrote: On Tuesday, 28 May 2024 at 17:37:42 UTC, bauss wrote: I have two questions that I can't seem to find a solution to after looking at std.datetime. First question is how do I get the current time but in milliseconds? Second

Re: Get milliseconds from time and construct time based on milliseconds

2024-05-28 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 28 May 2024 at 17:37:42 UTC, bauss wrote: I have two questions that I can't seem to find a solution to after looking at std.datetime. First question is how do I get the current time but in milliseconds? Second is how do I construct a time ex. systime or datetime based

Get milliseconds from time and construct time based on milliseconds

2024-05-28 Thread bauss via Digitalmars-d-learn
I have two questions that I can't seem to find a solution to after looking at std.datetime. First question is how do I get the current time but in milliseconds? Second is how do I construct a time ex. systime or datetime based on milliseconds? Thanks

Re: Milliseconds

2019-07-12 Thread Giovanni Di Maria via Digitalmars-d-learn
On Friday, 12 July 2019 at 07:21:58 UTC, Jonathan M Davis wrote: On Friday, July 12, 2019 12:51:28 AM MDT Giovanni Di Maria via Digitalmars- d-learn wrote: [...] You mean if the time is currently 15:46:52.7205007, you want an integer value that's 720? [...] Perfect Jonathan . Thank

Re: Milliseconds

2019-07-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, July 12, 2019 12:51:28 AM MDT Giovanni Di Maria via Digitalmars- d-learn wrote: > Hi > I have read much, before to write here. > How can i store, to an int variable, the milliseconds of the > current time? > It's simple, but i don't find the solution. > Thank you very

Milliseconds

2019-07-12 Thread Giovanni Di Maria via Digitalmars-d-learn
Hi I have read much, before to write here. How can i store, to an int variable, the milliseconds of the current time? It's simple, but i don't find the solution. Thank you very much. Giovanni Di Maria

Re: Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds

2015-01-30 Thread ketmar via Digitalmars-d-learn
On Fri, 30 Jan 2015 15:26:11 -0500, Steven Schveighoffer wrote: D absolutely needs a way to say this is ONLY for implementation, it's not part of the API. private fits this bill EXACTLY. yep. every sane person recognizing D private symbols as hidden. and then... BOOM! The Hidden Gems Of D.

Re: Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds

2015-01-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/30/15 12:49 PM, Jonathan M Davis via Digitalmars-d-learn wrote: On Friday, January 30, 2015 12:30:35 FG via Digitalmars-d-learn wrote: On 2015-01-30 at 12:08, Vladimir Panteleev wrote: On Friday, 30 January 2015 at 11:04:47 UTC, FG wrote: Bug or correct behaviour? Bug:

Re: Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds

2015-01-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, January 30, 2015 12:30:35 FG via Digitalmars-d-learn wrote: On 2015-01-30 at 12:08, Vladimir Panteleev wrote: On Friday, 30 January 2015 at 11:04:47 UTC, FG wrote: Bug or correct behaviour? Bug: https://issues.dlang.org/show_bug.cgi?id=1238

Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds

2015-01-30 Thread Suliman via Digitalmars-d-learn
foreach(f; files)) { if (canFind(to!string(f), )) { writeln(whitespace found:); writeln(f); Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds

Re: Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds

2015-01-30 Thread FG via Digitalmars-d-learn
On 2015-01-30 at 12:08, Vladimir Panteleev wrote: On Friday, 30 January 2015 at 11:04:47 UTC, FG wrote: Bug or correct behaviour? Bug: https://issues.dlang.org/show_bug.cgi?id=1238 https://github.com/D-Programming-Language/dmd/pull/3743 The fix is pretty much a one-liner. Probably 2.067

Re: Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds

2015-01-30 Thread FG via Digitalmars-d-learn
Error: module app struct std.regex.Thread(DataIndex) is private Did you import core.thread?

Re: Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds

2015-01-30 Thread FG via Digitalmars-d-learn
On 2015-01-30 at 11:55, FG wrote: Error: module app struct std.regex.Thread(DataIndex) is private Did you import core.thread? This is silly. Thread is internal to std.regex, yet when importing both std.regex and core.thread, you still get an error: src.d(10): Error: core.thread.Thread

Re: Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds

2015-01-30 Thread Jonathan M Davis via Digitalmars-d-learn
for 50 milliseconds } else continue; } Error: module app struct std.regex.Thread(DataIndex) is private Error: no property 'sleep' for type 'void' What's wrong? Why sleeping do not work? Did you import std.regex but not core.thread? Or did you import

Re: Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds

2015-01-30 Thread Vladimir Panteleev via Digitalmars-d-learn
On Friday, 30 January 2015 at 11:04:47 UTC, FG wrote: Bug or correct behaviour? Bug: https://issues.dlang.org/show_bug.cgi?id=1238