Skip to content

Commit

Permalink
Implemented StarTime and Uptime
Browse files Browse the repository at this point in the history
  • Loading branch information
marcpiechura committed Jan 18, 2016
1 parent 752289e commit 896134e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/Akka.API.Tests/CoreAPISpec.ApproveCore.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,10 @@ namespace Akka.Actor
public abstract Akka.Actor.IScheduler Scheduler { get; }
public abstract Akka.Serialization.Serialization Serialization { get; }
public abstract Akka.Actor.Settings Settings { get; }
public System.TimeSpan StartTime { get; }
[System.ObsoleteAttribute("Use WhenTerminated instead. This property will be removed in future versions")]
public abstract System.Threading.Tasks.Task TerminationTask { get; }
public System.TimeSpan Uptime { get; }
public abstract System.Threading.Tasks.Task WhenTerminated { get; }
public abstract Akka.Actor.IActorRef ActorOf(Akka.Actor.Props props, string name = null);
public abstract Akka.Actor.ActorSelection ActorSelection(Akka.Actor.ActorPath actorPath);
Expand Down
11 changes: 11 additions & 0 deletions src/core/Akka/Actor/ActorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Akka.Configuration;
using Akka.Dispatch;
using Akka.Event;
using Akka.Util;

namespace Akka.Actor
{
Expand Down Expand Up @@ -73,6 +74,16 @@ public abstract class ActorSystem : IActorRefFactory, IDisposable
/// <summary>Gets the log</summary>
public abstract ILoggingAdapter Log { get; }

/// <summary>
/// Start-up time since the epoch.
/// </summary>
public TimeSpan StartTime { get; } = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);

/// <summary>
/// Up-time of this actor system.
/// </summary>
public TimeSpan Uptime => MonotonicClock.ElapsedHighRes;

/// <summary>
/// Creates a new ActorSystem with the specified name, and the specified Config
/// </summary>
Expand Down

0 comments on commit 896134e

Please sign in to comment.