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?

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

# 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);

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

```
code
```

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

3 Likes

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

I just answered on StackOverflow here:

4 Likes