Skip to content

Commit daae153

Browse files
committed
Create TimeTotalMilliseconds.cs
1 parent 9bf7708 commit daae153

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Magic Cloud, copyright (c) 2023 Thomas Hansen. See the attached LICENSE file for details. For license inquiries you can send an email to [email protected]
3+
*/
4+
5+
using System;
6+
using magic.node;
7+
using magic.node.extensions;
8+
using magic.signals.contracts;
9+
10+
namespace magic.lambda.dates
11+
{
12+
/// <summary>
13+
/// [time.total-milliseconds] slot, returning how many milliseconds time object represents.
14+
/// </summary>
15+
[Slot(Name = "time.total-milliseconds")]
16+
public class TimeTotalMilliseconds : ISlot
17+
{
18+
/// <summary>
19+
/// Implementation of signal
20+
/// </summary>
21+
/// <param name="signaler">Signaler used to signal</param>
22+
/// <param name="input">Parameters passed from signaler</param>
23+
public void Signal(ISignaler signaler, Node input)
24+
{
25+
input.Value = input.GetEx<TimeSpan>().TotalMilliseconds;
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)