how to assign to shared obj.systime?

Kagamin spam at here.lot
Tue Jul 14 06:16:25 UTC 2020


---
import std;

shared class TimeCount {
	synchronized void startClock() {
		auto me = cast()this;
		me.startTime = Clock.currTime;
	}
	synchronized void endClock() {
		auto me = cast()this;
		me.endTime = Clock.currTime;
	}
	synchronized void calculateDuration() {
		auto me = cast()this;
		me.elapsed = me.endTime - me.startTime;
	}

	private:
	SysTime startTime;
	SysTime endTime;
	Duration elapsed;
}
---
forgot synchronized attribute


More information about the Digitalmars-d-learn mailing list