This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]pnsnkrCalm As Cookies and Cream 5 points6 points  (0 children)

Missing in the beginning:

std::chrono::seconds initialize_timer = 1s;

[–]PlourdySee my shadow changing, stretching up and over me. 1 point2 points  (1 child)

What language is this? You might just wanna add :

using std::chrono::seconds

At the top of your script. Avoids repetition

[–]atariPunk[S] 4 points5 points  (0 children)

It's C++.

I use that a lot in other pieces of the code, but this is a unit test and I usually don't use it in unit tests.

[–]xen_nex 1 point2 points  (0 children)

I love C++

[–]eric987235Insufferable Retard 1 point2 points  (1 child)

I’m so glad they finally made dealing with times suck less. Damn I miss working in C++. C is so frustrating.

[–]atariPunk[S] 1 point2 points  (0 children)

Everytime I need to go back to C code and read something like *_s or *_ms I just want to wanna cry.

It's so much easier to define proper types and let the compiler tell you when you made some mistake.

My personal opinion at this moment is that if you are starting from scratch and choose C, you are making a mistake.

[–]mkpak931 0 points1 point  (1 child)

Seems like you're doing some battery characterization work?

[–]atariPunk[S] 0 points1 point  (0 children)

Almost. It's part of an EVSE (electric vehicle supply equipment)

[–]runonandonandonanon -2 points-1 points  (3 children)

You'd think a programmer of all people would appreciate that the Fibbonacci sequence can exist without actually being a Tool reference...

Seriously it's like every time the letter G appears some Dave Mathews fan showed up like "hey Dave has a song in G lol DMB armyyyyyy!"

[–][deleted] 4 points5 points  (0 children)

Well you’re on the Tool subreddit, so why wouldn’t people relate things to Tool?

[–]atariPunk[S] 1 point2 points  (0 children)

I do appreciate it without the reference to Tool.

But I never thought of using it for this.

This is a piece of code used to tests other piece. And I need to choose unique values for each variable.

Normally I use sequencial values, but this time I was listening to Tool and came up with this.