Class

NumCosmoMathTimer

Description [src]

final class NumCosmoMath.Timer : GObject.Object
{
  /* No available fields */
}

Wall-clock timer with progress tracking for a task of a known number of items.

A task is started with ncm_timer_task_start() and advanced with ncm_timer_task_increment() or ncm_timer_task_accumulate(). The time per item is accumulated to give the mean time per item, the time left and the estimated end time. Functions returning a string return a buffer owned by the timer, which the next call to any of them overwrites.

Ancestors

Constructors

ncm_timer_new

Creates a new NcmTimer.

Functions

ncm_timer_clear

Decreases the reference count of nt by one and sets nt to NULL.

Instance methods

ncm_timer_continue

Resumes nt after ncm_timer_stop(). Aborts if a task is running.

ncm_timer_elapsed
No description available.

ncm_timer_elapsed_dhms

Splits ncm_timer_elapsed() into days, hours, minutes and seconds.

ncm_timer_elapsed_dhms_str

Formats ncm_timer_elapsed() as “[D days, ]HH:MM:SS.ssss”.

ncm_timer_elapsed_since_last_log

The ncm_timer_task_log functions record the time of the last completed item as the time of the log.

ncm_timer_free

Decreases the reference count of nt by one.

ncm_timer_ref

Increases the reference count of nt by one.

ncm_timer_set_name

Sets the name of nt, used in the task messages.

ncm_timer_start

Starts nt, resetting the elapsed time. Aborts if a task is running.

ncm_timer_stop

Stops nt. Aborts if a task is running.

ncm_timer_task_accumulate

Marks nitens items as completed, recording the time since the previous update divided by nitens as the time of each. Aborts if no task is running or if this passes the end of the task.

ncm_timer_task_add_tasks

Adds ptasks items to the running task. Aborts if no task is running.

ncm_timer_task_completed

Aborts if no task is running.

ncm_timer_task_continue

Resumes the timer after ncm_timer_task_pause(). Aborts if no task is running.

ncm_timer_task_cur_datetime_str

Formats the current local date and time.

ncm_timer_task_elapsed_str

Formats the number of completed items and the elapsed time. Aborts if no task is running.

ncm_timer_task_end

Ends the running task. Aborts if no task is running.

ncm_timer_task_end_datetime_str

Formats the local date and time at which the task is estimated to end, with the standard error of the time left. A value is “unknown” until it is defined: the mean after the first completed item, the standard error after the second update.

ncm_timer_task_estimate_by_time
No description available.

ncm_timer_task_has_ended

Aborts if no task is running.

ncm_timer_task_increment

Marks one item as completed, recording the time since the previous item. Aborts if no task is running or if the task is already complete.

ncm_timer_task_is_running
No description available.

ncm_timer_task_log_cur_datetime

Logs ncm_timer_task_cur_datetime_str().

ncm_timer_task_log_elapsed

Logs ncm_timer_task_elapsed_str().

ncm_timer_task_log_end_datetime

Logs ncm_timer_task_end_datetime_str().

ncm_timer_task_log_mean_time

Logs ncm_timer_task_mean_time_str().

ncm_timer_task_log_start_datetime

Logs ncm_timer_task_start_datetime_str().

ncm_timer_task_log_time_left

Logs ncm_timer_task_time_left_str().

ncm_timer_task_mean_time
No description available.

ncm_timer_task_mean_time_str

Formats the mean time per item with its standard error. Aborts if no task is running. A value is “unknown” until it is defined: the mean after the first completed item, the standard error after the second update.

ncm_timer_task_pause

Stops the timer during a task. Aborts if no task is running.

ncm_timer_task_start

Starts a task of task_len items and restarts the timer. Aborts if a task is running or if task_len is zero.

ncm_timer_task_start_datetime_str

Formats the local date and time now minus ncm_timer_elapsed(), which is the start of the timer if it was never stopped.

ncm_timer_task_time_left
No description available.

ncm_timer_task_time_left_str

Formats ncm_timer_task_time_left() with its standard error. Aborts if no task is running. A value is “unknown” until it is defined: the mean after the first completed item, the standard error after the second update.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

NumCosmoMath.Timer:name

The name used in the task messages.

NumCosmoMath.Timer:task-len

The number of items of the running task, zero if no task is running.

NumCosmoMath.Timer:task-pos

The number of completed items of the task, in [0, NcmTimer:task-len].

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct NumCosmoMathTimerClass {
  GObjectClass parent_class;
  
}

No description available.

Class members
parent_class: GObjectClass

No description available.