As pointed out by user3112728 in this response:
"Clock Sequence" seems like a really misleading name. Based on its definition, a better name might be "Random Component of uuid".
There is the clock sequence of a given GUID, it's the forth block, you can retrieve it more or less gracefully:
Console.WriteLine(Guid.NewGuid().ToString().Split('-')[3]);
But there is no such a thing as the clock sequence (as an eidos).
The 4th block of a GUID is generated by an algorithm that should follow some rules, but these are not restrictive enough for the implementation to be unique, based on this post those are:
The RFC-4122 says that the clock sequence must be changed when:
the clock is backwards;
the clock might have been set backwards;
the generator is not sure if the clock is backwards or not;
the node identifier changed;
node identifiers are getting mixed up.
So basically, if you want to implement a clock sequence algorithm, you have to store a value and change it whenever one of these conditions occur.
The just change it part is loose, that why there is no unique implementation.
You can go with something like this:
// Change clock sequence because clock is backwards
// This is a definitely incomplete example
if (now <= lastTime) {
clockSequence++
}
However, I don't see the point of reinventing the wheel here.
Update: Here, here and here some info/implementations of sequential GUIDs;