Class TimeSpanExtensions
Namespace: Couchbase.Utils
Assembly: Couchbase.NetClient.dll
Syntax
public static class TimeSpanExtensions : object
Methods
| Improve this Doc View SourceGetSeconds(TimeSpan)
Retrieves the number of seconds expressed in a
Declaration
public static uint GetSeconds(this TimeSpan timeSpan)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | timeSpan | The timespan. |
Returns
Type | Description |
---|---|
UInt32 | An |
ToTtl(UInt32)
Converts a duration expressed as milliseconds to a unix-based TTL.
Declaration
public static uint ToTtl(this uint duration)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | duration | Milliseconds to use as TTL. |
Returns
Type | Description |
---|---|
UInt32 | The TTL, expressed as a unix-based TTL in milliseconds. |
ToTtl(TimeSpan)
Converts a
Declaration
public static uint ToTtl(this TimeSpan duration)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | duration |
Returns
Type | Description |
---|---|
UInt32 | The TTL, expressed as a suitable uint. |