|
|
|
@ -57,6 +57,9 @@ namespace Grpc.Core.Internal |
|
|
|
|
[DllImport("grpc_csharp_ext.dll")] |
|
|
|
|
static extern Timespec gprsharp_inf_past(GPRClockType clockType); |
|
|
|
|
|
|
|
|
|
[DllImport("grpc_csharp_ext.dll")] |
|
|
|
|
static extern Timespec gprsharp_convert_clock_type(Timespec t, GPRClockType targetClock); |
|
|
|
|
|
|
|
|
|
[DllImport("grpc_csharp_ext.dll")] |
|
|
|
|
static extern int gprsharp_sizeof_timespec(); |
|
|
|
|
|
|
|
|
@ -132,6 +135,14 @@ namespace Grpc.Core.Internal |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Converts the timespec to desired clock type. |
|
|
|
|
/// </summary> |
|
|
|
|
public Timespec ToClockType(GPRClockType targetClock) |
|
|
|
|
{ |
|
|
|
|
return gprsharp_convert_clock_type(this, targetClock); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Converts Timespec to DateTime. |
|
|
|
|
/// Timespec needs to be of type GPRClockType.Realtime and needs to represent a legal value. |
|
|
|
|