Re: [PATCH net-next v2 3/6] rust: time: Implement addition of Ktime and Delta

From: FUJITA Tomonori
Date: Mon Oct 07 2024 - 02:06:18 EST


On Sun, 06 Oct 2024 12:45:06 +0200
Fiona Behrens <me@xxxxxxxxxx> wrote:

>> On Sat, Oct 05, 2024 at 09:25:28PM +0900, FUJITA Tomonori wrote:
>>> Implement Add<Delta> for Ktime to support the operation:
>>>
>>> Ktime = Ktime + Delta
>>>
>>> This is used to calculate the future time when the timeout will occur.
>>
>> Since Delta can be negative, it could also be a passed time. For a
>> timeout, that does not make much sense.
>>
>
> Are there more usecases than Delta? Would it make sense in that case to also implement Sub as well?

We might add the api to calculate the elapsed time when it becomes
necessary:

Delta = Ktime - Ktime