# Updating an old model and running into deprecation and getting errors I have fixed a lot, tic toc problem here what is the best solution to replace?

**URL:** <https://discourse.julialang.org/t/updating-an-old-model-and-running-into-deprecation-and-getting-errors-i-have-fixed-a-lot-tic-toc-problem-here-what-is-the-best-solution-to-replace/79694>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [April 19, 2022, 3:09pm UTC](https://discourse.julialang.org/t/updating-an-old-model-and-running-into-deprecation-and-getting-errors-i-have-fixed-a-lot-tic-toc-problem-here-what-is-the-best-solution-to-replace/79694 "2022-04-19T15:09:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![34MidwayMonsta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/34midwaymonsta/32/35508_2.png) [@34MidwayMonsta](https://discourse.julialang.org/u/34MidwayMonsta)\
**Post date:** [April 19, 2022, 3:09pm UTC](https://discourse.julialang.org/t/updating-an-old-model-and-running-into-deprecation-and-getting-errors-i-have-fixed-a-lot-tic-toc-problem-here-what-is-the-best-solution-to-replace/79694/1 "2022-04-19T15:09:37Z")

</div>

Calculating baseball linueps.  
3 lineups  
Formulation baseball\_formulation  
Overlap = 6  
Stack size = 5  
LoadError: UndefVarError: tic not defined  
in expression starting at C:\Users\Carlos Soto\Daily-Fantasy-Baseball-Contests-in–master\optimize\_multiple\_lineups\_baseball.jl:43

Stacktrace:  
[1] top-level scope  
@ C:\Users\Carlos Soto\Daily-Fantasy-Baseball-Contests-in–master\optimize\_multiple\_lineups\_baseball.jl:43  
[2] include(fname::String)  
@ Base.MainInclude .\client.jl:451  
[3] top-level scope  
@ In[29]:1  
[4] eval  
@ .\boot.jl:373 [inlined]  
[5] include\_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)  
@ Base .\loading.jl:1196

code listed below

```julia
# This code solves for multiple baseball lineups
using DataFrames
using CSV
include("data_cleaning.jl")
include("baseball_formulations.jl") #this code has all the different formualations

################################################################################################################
################################################################################################################
################################################################################################################

#INPUT PARAMS
# num_lineups is the total number of lineups
num_lineups = 3; 

# num_overlap is the maximum overlap of players between the lineups 
num_overlap = 6

#number of hitters in the stack (number of consecutive hitters in the hitting order)
stack_size = 5; 

#FORMULATION: formulation is the type of formulation that you would like to use. 
formulation = baseball_formulation

path_pitchers = "2016-08-12 pitchers.csv" 
path_hitters = "2016-08-12 hitters.csv";

# path_to_output is a string that gives the path to the csv file that will give the outputted results
path_to_output= string(string(formulation), "_stacksize_", stack_size,"_overlap_", num_overlap,"_lineups_", num_lineups,".csv"); 

# path_to_output_proj is a string that gives the path to the csv file that will give the outputted results with projected lineup points
path_to_output_proj = string("proj_baseball_", string(formulation), "_stacksize_", stack_size,"_overlap_", num_overlap,"_lineups_", num_lineups,".csv"); 

# path_to_output_actual is a string that gives the path to the csv file that will give the outputted results with projected and actual lineup points
path_to_output_actual = string("actual_baseball_", string(formulation), "_stacksize_", stack_size,"_overlap_", num_overlap,"_lineups_", num_lineups,".csv"); 

#########################################################################
# Running the code
println("Calculating baseball linueps.\n ", num_lineups, " lineups\n","Formulation ",formulation,
"\nOverlap = ", num_overlap,"\nStack size = ", stack_size)

tic()
create_lineups(num_lineups, num_overlap, stack_size,formulation, path_pitchers,path_hitters, path_to_output);
telapsed = toq();

println("\nCalculated baseball lineups.\n\tNumber of lineups = ", num_lineups, " \n\tStack size = ",stack_size,
"\n\tOverlap = ", num_overlap,"\n" )

println("Took ", telapsed/60.0, " minutes to calculate ", num_lineups, " lineups")

println("Saving data to file ",path_to_output,"\n")

#save the projected and actual points for the lineups
lineup_points_proj(path_to_output,path_hitters,path_pitchers,path_to_output_proj);
#lineup_points_actual(path_to_output,path_hitters,path_pitchers,path_to_output_actual);

```

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [April 19, 2022, 5:45pm UTC](https://discourse.julialang.org/t/updating-an-old-model-and-running-into-deprecation-and-getting-errors-i-have-fixed-a-lot-tic-toc-problem-here-what-is-the-best-solution-to-replace/79694/2 "2022-04-19T17:45:38Z")

</div>

Welcome @34MidwayMonsta  
You can put your code into three backticks:

> ````julia
> ```
> code
> ```
> 
> ````

to have it properly formated.  
And this is a good starter for asking questions:

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

<div class="post-metadata">

**Author:** ![34MidwayMonsta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/34midwaymonsta/32/35508_2.png) [@34MidwayMonsta](https://discourse.julialang.org/u/34MidwayMonsta)\
**Post date:** [April 19, 2022, 6:28pm UTC](https://discourse.julialang.org/t/updating-an-old-model-and-running-into-deprecation-and-getting-errors-i-have-fixed-a-lot-tic-toc-problem-here-what-is-the-best-solution-to-replace/79694/3 "2022-04-19T18:28:59Z")

</div>

Thank you, for that piece of knowledge. It is much appreciated.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [April 20, 2022, 8:15am UTC](https://discourse.julialang.org/t/updating-an-old-model-and-running-into-deprecation-and-getting-errors-i-have-fixed-a-lot-tic-toc-problem-here-what-is-the-best-solution-to-replace/79694/4 "2022-04-20T08:15:13Z")

</div>

I just answered on StackOverflow here:

[https://stackoverflow.com/questions/71928408/updating-an-old-model-and-running-into-deprecation-and-getting-errors-i-have-fix/71936165#71936165](https://stackoverflow.com/questions/71928408/updating-an-old-model-and-running-into-deprecation-and-getting-errors-i-have-fix/71936165#71936165)
