I wrote a module to ease time measurement in my projects.
Does anyone know how to get elapsed milli- or nanoseconds under linux?
Want to make it portable :)
module time;
version(Windows)
import std.c.windows.windows;
long frequency; /// frequency of the high
Trass3r wrote:
Is there any way to loop through specific members of a class, e.g. all
public functions?
I've already seen a function getMembers in druntime's ClassInfo class
but I can't find anything related to the attributes there.
Assuming you're using D2,
Trass3r wrote:
I wrote a module to ease time measurement in my projects.
Does anyone know how to get elapsed milli- or nanoseconds under linux?
Want to make it portable :)
[snip]
Check std.perf; it's documented, but sadly doesn't show up in the docs.
-- Daniel
Daniel Keep schrieb:
Assuming you're using D2, http://digitalmars.com/d/2.0/traits.html might
prove to be of interest.
-- Daniel
It is indeed of interest though being not exactly what I want. Seems
like there's currently no way to get attributes like public etc.
But I think an acceptable
Trass3r wrote:
Daniel Keep schrieb:
Assuming you're using D2, http://digitalmars.com/d/2.0/traits.html might
prove to be of interest.
-- Daniel
It is indeed of interest though being not exactly what I want. Seems
like there's currently no way to get attributes like public etc.
But
On Mon, Jan 19, 2009 at 12:57 PM, Ellery Newcomer
ellery-newco...@utulsa.edu wrote:
IndexExpression:
PostfixExpression [ ArgumentList ]
The only place I can think of ArgumentList containing more than one element
is in some sort of overloaded operator case.
You're precisely right.
Silvio Ricardo Cordeiro wrote:
Is there any good reason why the following code doesn't work?
The function foo requires as its argument a delegate that
receives a B. This means that, because of the type soundness
of the D language, the delegate will only be called with instances
of B. Now,
Steven Schveighoffer wrote:
Hoenir wrote
So why don't they port tango to that D1 version of druntime?
What is the need?
I can only think of one reason: When porting Tango to D2, it'll be one less
thing to do.
Reply to Ellery,
I don't buy that. Not that I'm a C guru or anything, but it looks to
me that Parser::BaseClasses could be easily edited to make the point
in question go away.
it's not a parser thing but a grammar thing. It would be complex to define
a grammar that allows one each of the
On Tue, Jan 20, 2009 at 2:19 AM, Trass3r mrmoc...@gmx.de wrote:
Daniel Keep schrieb:
Check std.perf; it's documented, but sadly doesn't show up in the docs.
-- Daniel
Cool, is similar to my design. Though GetTickCount64 could be added.
That's odd. I made some updates to std.perf a while
Reply to Lutger,
Another possible hack: if used from a
different module, you could use the 'compiles' trait with allMembers
to find out if a member can be accessed.
you could define a template in another module that does the check and returns
the result.
On Mon, Jan 19, 2009 at 1:46 PM, Jason House
jason.james.ho...@gmail.com wrote:
Trass3r wrote:
I wrote a module to ease time measurement in my projects.
Does anyone know how to get elapsed milli- or nanoseconds under linux?
Want to make it portable :)
The difficulty of doing platform
BCS schrieb:
Reply to Lutger,
Another possible hack: if used from a
different module, you could use the 'compiles' trait with allMembers
to find out if a member can be accessed.
you could define a template in another module that does the check and
returns the result.
Well, it'd indeed
On Tue, Jan 20, 2009 at 4:47 AM, Jarrett Billingsley
jarrett.billings...@gmail.com wrote:
On Mon, Jan 19, 2009 at 1:46 PM, Jason House
jason.james.ho...@gmail.com wrote:
Trass3r wrote:
I wrote a module to ease time measurement in my projects.
Does anyone know how to get elapsed milli- or
Jarrett Billingsley schrieb:
On Mon, Jan 19, 2009 at 10:41 AM, Daniel Keep
daniel.keep.li...@gmail.com wrote:
Trass3r wrote:
I wrote a module to ease time measurement in my projects.
Does anyone know how to get elapsed milli- or nanoseconds under linux?
Want to make it portable :)
[snip]
Reply to Daniel,
It depends on what exactly you're trying to do. Some time ago, I
wrote a library that created XML loaders for structs, and it needed to
know the names of fields. Pre-traits, this is what I used:
struct Stuff
{
int foo;
char[] bar;
alias Tuple!(foo, bar) _fields;
}
Then I
On Tue, Jan 20, 2009 at 6:04 AM, Trass3r mrmoc...@gmx.de wrote:
Jarrett Billingsley schrieb:
On Mon, Jan 19, 2009 at 10:41 AM, Daniel Keep
daniel.keep.li...@gmail.com wrote:
Trass3r wrote:
I wrote a module to ease time measurement in my projects.
Does anyone know how to get elapsed milli-
Denis Koroskin wrote:
Arrays in D are reference types. Besides, it's best to avoid hidden
allocations.
Arrays in D are reference types except when they're not.
int[] a = [5];
int[] b = a;
a[0] = 4;
assert(b[0] == 4);
a.length = 2;
assert(b.length == 1);
a[0] = 3;
// Is b[0] 3 or 4?
--
Daniel Keep schrieb:
Another possible hack: if used from a
different module, you could use the 'compiles' trait with allMembers
to find out if a member can be accessed.
you could define a template in another module that does the check and
returns the result.
Well, it'd indeed be used from a
Jason House wrote:
Silvio Ricardo Cordeiro wrote:
Is there any good reason why the following code doesn't work?
The function foo requires as its argument a delegate that
receives a B. This means that, because of the type soundness
of the D language, the delegate will only be called with
BCS wrote:
Reply to Daniel,
It depends on what exactly you're trying to do. Some time ago, I
wrote a library that created XML loaders for structs, and it needed to
know the names of fields. Pre-traits, this is what I used:
struct Stuff
{
int foo;
char[] bar;
alias Tuple!(foo,
BCS wrote:
Reply to Ellery,
I don't buy that. Not that I'm a C guru or anything, but it looks to
me that Parser::BaseClasses could be easily edited to make the point
in question go away.
it's not a parser thing but a grammar thing. It would be complex to
define a grammar that allows one
Reply to Ellery,
BCS wrote:
Reply to Ellery,
I don't buy that. Not that I'm a C guru or anything, but it looks to
me that Parser::BaseClasses could be easily edited to make the point
in question go away.
it's not a parser thing but a grammar thing. It would be complex to
define a grammar
Reply to Ellery,
I don't buy that either. The subject was access specifiers for base
classes, not storage classes for declarations or access specifiers for
statements. In those cases I would grant your point, but a base class
has precisely one access specifier and no storage classes. It would
24 matches
Mail list logo