public override void OnCreate() { base.OnCreate(); Log.Info(TAG, "OnCreate: the service is initializing."); timestamper = new UtcTimestamper(); handler = new Handler(); // This Action is only for demonstration purposes. runnable = new Action(() => { if (timestamper != null) { Log.Debug(TAG, timestamper.GetFormattedTimestamp()); handler.PostDelayed(runnable, DELAY_BETWEEN_LOG_MESSAGES); } }); }
public override void OnCreate() { base.OnCreate(); Log.Info(TAG, "OnCreate: the service is initializing."); timestamper = new UtcTimestamper(); handler = new Handler(); // This Action is only for demonstration purposes. runnable = new Action(() => { if (timestamper != null) { Log.Debug(TAG, timestamper.GetFormattedTimestamp()); handler.PostDelayed(runnable, DELAY_BETWEEN_LOG_MESSAGES); } }); }
/// <summary> /// This method will return a formatted timestamp to the client. /// </summary> /// <returns>A string that details what time the service started and how long it has been running.</returns> string GetFormattedTimestamp() { return(timestamper?.GetFormattedTimestamp()); }