From b349777b348cabfe6a24d0036bf3620651947386 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Wed, 20 Mar 2002 01:30:11 +0000 Subject: new option -t (--time) --- mixutils/mixvm_loop.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'mixutils/mixvm_loop.c') diff --git a/mixutils/mixvm_loop.c b/mixutils/mixvm_loop.c index 74ea8f8..a158427 100644 --- a/mixutils/mixvm_loop.c +++ b/mixutils/mixvm_loop.c @@ -1,9 +1,9 @@ /* -*-c-*- -------------- mixvm_loop.c : * Implementation of mix vm command loop. * ------------------------------------------------------------------ - * $Id: mixvm_loop.c,v 1.7 2001/09/24 23:27:02 jao Exp $ + * $Id: mixvm_loop.c,v 1.8 2002/03/20 01:30:11 jao Exp $ * ------------------------------------------------------------------ - * Copyright (C) 2000, 2001 Free Software Foundation, Inc. + * Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -127,12 +127,18 @@ mix_vmloop (int argc, char *argv[], gboolean initfile, /* run a program and exit */ void -mix_vmrun (const gchar *code_file, gboolean dump) +mix_vmrun (const gchar *code_file, gboolean dump, gboolean ptime) { + gchar *time_cmd = ptime? g_strdup("stime on") : g_strdup("stime off"); + gchar *run_cmd = g_strdup("run"); + gchar *dump_cmd = dump? g_strdup("pall") : NULL; gboolean result; init_mixvm_ (code_file, FALSE); - result = mixvm_cmd_exec (g_strdup ("run")); - if (result && dump) mixvm_cmd_exec (g_strdup ("pall")); + result = mixvm_cmd_exec (time_cmd) && mixvm_cmd_exec (run_cmd); + if (result && dump) mixvm_cmd_exec (dump_cmd); mix_config_delete (config_); + g_free(time_cmd); + g_free(run_cmd); + if (dump_cmd) g_free(dump_cmd); } -- cgit v1.2.3