Re: How to get current time as long or ulong?

2016-07-06 Thread Charles Hixson via Digitalmars-d-learn
On 07/06/2016 10:32 AM, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, Jul 06, 2016 at 10:19:19AM -0700, Charles Hixson via Digitalmars-d-learn wrote: [...] The same time needs to be used for two different purposes (or I have to keep two separate times). One time is used during a

Re: How to get current time as long or ulong?

2016-07-06 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jul 06, 2016 at 10:19:19AM -0700, Charles Hixson via Digitalmars-d-learn wrote: [...] > The same time needs to be used for two different purposes (or I have > to keep two separate times). One time is used during a particular run > of the program to compare when two different things

Re: How to get current time as long or ulong?

2016-07-06 Thread Charles Hixson via Digitalmars-d-learn
On 07/05/2016 05:23 PM, Jonathan M Davis via Digitalmars-d-learn wrote: On Tuesday, July 05, 2016 12:51:54 Charles Hixson via Digitalmars-d-learn wrote: On 07/05/2016 11:43 AM, Jonathan M Davis via Digitalmars-d-learn wrote: On Tuesday, July 05, 2016 11:16:31 Charles Hixson via

Re: How to get current time as long or ulong?

2016-07-06 Thread yawniek via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 18:16:31 UTC, Charles Hixson wrote: What I'm looking for is the opposite of the "FromUnixTime" function. i often use long toNsUnixTime(SysTime t) { return (t.stdTime - 621_355_968_000_000_000L)*100; } as a helper. any chance that something like this can be put

Re: How to get current time as long or ulong?

2016-07-05 Thread Charles Hixson via Digitalmars-d-learn
Thank you for confirming the change. It hasn't made any difference during the tests so far, but it sounds like it soon would have. I don't really want a long...but an int rolls over too quickly, and there's no 48 bit time. The time is basically for use over smaller intervals, but

Re: How to get current time as long or ulong?

2016-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 05, 2016 12:51:54 Charles Hixson via Digitalmars-d-learn wrote: > On 07/05/2016 11:43 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > > On Tuesday, July 05, 2016 11:16:31 Charles Hixson via Digitalmars-d-learn > > > > wrote: > >> What I'm looking for is the opposite of the

Re: How to get current time as long or ulong?

2016-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 05, 2016 16:18:19 Charles Hixson via Digitalmars-d-learn wrote: > I guess I was expressing myself poorly, probably due to muddled thinking > about the representation of time. > > Based on various hints from you and others my current guess is that I > should use: > > longnow()

Re: How to get current time as long or ulong?

2016-07-05 Thread Charles Hixson via Digitalmars-d-learn
I guess I was expressing myself poorly, probably due to muddled thinking about the representation of time. Based on various hints from you and others my current guess is that I should use: longnow() { returnClock.currTime().stdTime;} IIUC this should return the current system

Re: How to get current time as long or ulong?

2016-07-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/5/16 3:51 PM, Charles Hixson via Digitalmars-d-learn wrote: On 07/05/2016 11:43 AM, Jonathan M Davis via Digitalmars-d-learn wrote: On Tuesday, July 05, 2016 11:16:31 Charles Hixson via Digitalmars-d-learn wrote: What I'm looking for is the opposite of the "FromUnixTime" function.

Re: How to get current time as long or ulong?

2016-07-05 Thread Charles Hixson via Digitalmars-d-learn
On 07/05/2016 11:43 AM, Jonathan M Davis via Digitalmars-d-learn wrote: On Tuesday, July 05, 2016 11:16:31 Charles Hixson via Digitalmars-d-learn wrote: What I'm looking for is the opposite of the "FromUnixTime" function. SysTime has toUnixTime, which is right above fromUnixTime in the

Re: How to get current time as long or ulong?

2016-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 05, 2016 11:43:32 Jonathan M Davis via Digitalmars-d-learn wrote: > But if what you want is a time_t, and you don't want to deal with SysTime, > there's no point in using std.datetime. Just use core.time to call C's time > function. Actually, I should qualify this. I keep

Re: How to get current time as long or ulong?

2016-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 05, 2016 18:25:17 John via Digitalmars-d-learn wrote: > On Tuesday, 5 July 2016 at 18:16:31 UTC, Charles Hixson wrote: > > I've been reading std.datetime documentation backwards and > > forwards, but if the information is there, I've been missing it. > > > > How do I get the

Re: How to get current time as long or ulong?

2016-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 05, 2016 11:16:31 Charles Hixson via Digitalmars-d-learn wrote: > What I'm looking for is the opposite of the "FromUnixTime" function. SysTime has toUnixTime, which is right above fromUnixTime in the documentation. But if what you want is a time_t, and you don't want to deal

Re: How to get current time as long or ulong?

2016-07-05 Thread ag0aep6g via Digitalmars-d-learn
On 07/05/2016 08:16 PM, Charles Hixson via Digitalmars-d-learn wrote: What I'm looking for is the opposite of the "FromUnixTime" function. That would be the "toUnixTime" method then, I suppose. https://dlang.org/phobos/std_datetime.html#.SysTime.toUnixTime

Re: How to get current time as long or ulong?

2016-07-05 Thread John via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 18:16:31 UTC, Charles Hixson wrote: I've been reading std.datetime documentation backwards and forwards, but if the information is there, I've been missing it. How do I get the current time as a long? Clock.currTime() returns a SysTime, and while currently I can

How to get current time as long or ulong?

2016-07-05 Thread Charles Hixson via Digitalmars-d-learn
I've been reading std.datetime documentation backwards and forwards, but if the information is there, I've been missing it. How do I get the current time as a long? Clock.currTime() returns a SysTime, and while currently I can convert that to a long, this is because I looked into the code.